Skip to content

Instantly share code, notes, and snippets.

@adacable
Created October 28, 2022 12:54
Show Gist options
  • Save adacable/72af4136b427254a121e92620ef7f2b8 to your computer and use it in GitHub Desktop.
Save adacable/72af4136b427254a121e92620ef7f2b8 to your computer and use it in GitHub Desktop.
import requests
from bs4 import BeautifulSoup
urlbase = "https://www.powercut105.com/FindOperator?Postcode="
def getalpha(postcode):
postcodeList = postcode.split(" ")
url = urlbase + "+".join(postcodeList)
r = requests.get(url)
return BeautifulSoup(r.content,"html.parser").find("span",class_="highlight_blockletter").text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment