简体   繁体   中英

Selenium not able to load the given URL instead loading the main page

from selenium import webdriver

driver = webdriver.Chrome(executable_path=r"C:\Users\chromedriver.exe")
driver.get("https://www.bestbuy.com/site/promo/health-fitness-deals")

tag = driver.find_elements_by_tag_name('h4')
for a in tag:
    for link in a.find_elements_by_tag_name('a'):
        print(link.get_attribute("href"))

Main Page that is being loaded by the website:

The page that I want to scrape: https://www.bestbuy.com/site/promo/health-fitness-deals

you can this link instead https://www.bestbuy.com/site/promo/health-fitness-deals?intl=nosplash so basically you'll add intl=nosplash to the link

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