简体   繁体   中英

selenium (python) webdriver JavaScript (noscrypt)

I am trying to scraping data from a site provide note of student to make analysis I try this good

from selenium import webdriver
#set chromodriver.exe path
driver = webdriver.Chrome(executable_path="C:\\chromedriver.exe")
#set page load timeout

#launch URL
driver.get("https://amatti.education.gov.dz/")

the first thing happen when run this code is open the site : [the site open normal][1] https://i.stack.imgur.com/ay7QJ.png after the site open it go to this site :

[after open go to this site][2] https://i.stack.imgur.com/NWvEa.png

I notice there is this good in the html of the site that mean if the browser not support JavaScript will go to URL : google.com

<noscript>
    <meta http-equiv="refresh" content="0; url=http://www.google.com/" />
</noscript>

there is any solution to automate this site [1]: https://i.stack.imgur.com/ay7QJ.png [2]: https://i.stack.imgur.com/NWvEa.png

I found the solution the problem comes from WebDrive the site knows there is bot scraping data so i use this argument

options.add_argument("--disable-blink-features=AutomationControlled")

and its work fine

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM