I am trying to submit a form, which is practically using a shipping company's website, submitting a tracking number and getting the result so that I can use beautifulsoup eventually to get the data I need. When I try this manually it returns the data, but with the python code it returns an non-formatted page and the data I need is not there as if the query was not executed. It returns
Your Current Browser
Is Not Supported !
which cannot be true since I am using the latest Google Chrome v.60
Where is the problem with the code?
code:
import requests
import webbrowser
from bs4 import BeautifulSoup
url = "https://www.nykline.com/ecom/CUP_HOM_3000.do?redir=Y"
payload = {'cargoTrackingNo':'TEMU9538796'}
r = requests.get(url, params=payload)
with open("results.html", "wb") as f:
f.write(r.content)
webbrowser.open("results.html")