我正在尝试从下面的此链接抓取结果
,以及下面的Python 3代码。但我回到同一页面。看起来数据18/5666 / FUL尚未使用。
import urllib.request
import urllib.parse
import urllib
import urllib3
url = "https://publicaccess.barnet.gov.uk/online-applications/search.do?action=simple&searchType=Application"
user_agent = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36'
values = {"searchCriteriaForm":"18/5666/FUL"}
headers = { 'User-Agent': user_agent,'Referer': 'https://publicaccess.barnet.gov.uk/online-applications/search.do?action=simple&searchType=Application'}
data = urllib.parse.urlencode(values)
request = urllib.request.Request(url,data.encode('UTF -8'),headers)
response = urllib.request.urlopen(request)
print(response.read())