I'm trying to scrape a web page with JS script executed on it.
I can get the HTML with the none executed JS using from requests import get
But I can't have the JS function result like when I inspect the webpage with mozilla
here the function I would like to get the result from:
function showFlight(idPilote, idFlight, idActivite)
any idea how to do that?
I've tried this
def kmlScrape(target):
curl = pycurl.Curl()
curl.setopt(pycurl.CAINFO, certifi.where())
curl.setopt(pycurl.SSL_VERIFYPEER, 0)
curl.setopt(pycurl.URL, target)
curl.setopt(pycurl.WRITEFUNCTION, e.write)
curl.perform()
return e
or
response = get(target)
print(response.text)
html_soup = BeautifulSoup(response.text, 'html.parser')
what I'm trying to do is to write this curl command in pycurl format:
curl "https://www.syride.com/scripts/ajx_vols.php?p=/en/flights/&idPays=0&pseudo=0&typePratique=0&page=01&idSpot=0&recherche=&order=&tri=&l=en" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0" -H "Accept: */*" -H "Accept-Language: en-US,en;q=0.5" --compressed -H "X-Requested-With: XMLHttpRequest" -H "DNT: 1" -H "Connection: keep-alive" -H "Referer: https://www.syride.com/en/flights/&idPays=0&pseudo=0&typePratique=0&page=01&idSpot=0&recherche=&order=&tri=" -H "Cookie: instruments2=5ai6jgg9p6bpkh3m7slf0b2vq7; gb__ssyride=aufnlupslr259o49nc98qm1t55" -H "Cache-Control: max-age=0"
any help very welcome.
Thanks, Mat