当尝试打开某个显示带有selenium-python的外套的URL时,该页面会自动将我重定向到欧洲主屏幕
URL = 'https://shop-usa.palaceskateboards.com/products/reversible-spherie-jacket-gold-petrol'
browser = webdriver.Chrome()
browser.get(URL)
webbrowser.open(URL)
是否要阻止它重定向我?
答案 0 :(得分:0)
禁用javascript
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_experimental_option( "prefs",{'profile.managed_default_content_settings.javascript': 2})
browser = webdriver.Chrome(executable_path='/path/to/chromedriver',chrome_options=chrome_options)
url='https://shop-usa.palaceskateboards.com/products/reversible-spherie-jacket-gold-petrol'
browser.get(url)