测试 selenium 附加到浏览器
This commit is contained in:
parent
c3c1e6ccc4
commit
f2fc675d51
2
main.py
2
main.py
@ -8,7 +8,7 @@ if __name__ == '__main__':
|
||||
options.add_argument('lang=zh-CN')
|
||||
options.add_argument(
|
||||
'user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36')
|
||||
# options.add_argument('--user-data-dir=./UserData/Google/Chrome/Default')
|
||||
# options.add_argument(r'--user-data-dir=E:\Repository\skcks.cn\python-selenium-spider\tmp\UserData')
|
||||
options.add_argument('--disable-gpu') # 如果不加这个选项,有时定位会出现问题
|
||||
# options.add_argument('--headless') # 增加无界面选项
|
||||
|
||||
|
BIN
screenshot.png
BIN
screenshot.png
Binary file not shown.
Before Width: | Height: | Size: 336 KiB After Width: | Height: | Size: 315 KiB |
Loading…
Reference in New Issue
Block a user