python - 如何在网站上使用 Selenium python?现在被网站屏蔽了
问题描述
我尝试制作一个脚本女巫来解析网站 bet365.com。但是这个网站是块硒,页面打不开。我有一个代码:
options = Options()
ua = UserAgent()
userAgent = ua.random
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)
options.add_experimental_option("detach", True)
options.add_argument('--no-sandbox')
options.add_argument(f'user-agent={userAgent}')
driver = webdriver.Chrome(chrome_options=options)
driver.get('https://www.bet365.com/')
它不起作用。有人可以帮忙吗?
它只是打开浏览器,什么也不做。对于其他网站,这是正确的,这是屏幕截图[1]:https ://i.stack.imgur.com/wc5pd.png
解决方案
推荐阅读
- camera - 在 SwiftUI 中翻译相机的按钮文本(“取消”、“重拍”和“使用照片”)
- python - Json_Normalize,针对特定列中的嵌套列?
- python - 如何在 python 中使用 json 渲染带有 jinja2 的模板?
- javascript - 文本不会出现在 Babylon.js 的顶部
- iot - RPL 协议中有多个父级
- windows - Azure-Pipelines - 需要 Ctrl+C 或键入“y”结束的脚本
- ios - 在 SwiftUI/UIKit 中,工作表没有以演示模式关闭?
- swift - 不断收到错误'类型''的值没有成员''
- python - 在 Python 枕头中为图像添加黑色空间
- javascript - 在javascript中组合多个类似的功能