简体   繁体   English

使用 Selenium 时访问被拒绝

[英]Access Denied while using Selenium

I am trying to navigate through this site to see the offer available at this address but I get an access denied error.我正在尝试浏览此站点以查看此地址提供的优惠,但我收到拒绝访问错误。 Any recommendations on getting around this?关于解决这个问题的任何建议?

from selenium import webdriver

browser = webdriver.Chrome('/chromedriver')
browser.get('https://official.spectrum.com/')

addressSearch = browser.find_element_by_id('street-hero')
addressSearch.send_keys('5214 Wentworth Dr')

zipSearch = browser.find_element_by_id('zip-hero')
zipSearch.send_keys('78413')

submitBtn = browser.find_element_by_xpath('//*[@id="form-section"]/form/button')
submitBtn.click()

In general you need to make sure that chromedriver_path is accessible for the user that is executing the script and with right permissions通常,您需要确保执行脚本的用户可以访问chromedriver_path并且具有正确的权限

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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