找以下代码bugimport jsonfrom seleniumwire import webdriverfrom seleniumwebdriver import ChromeOptionsfrom seleniumwebdrivercommonkeys import Keysfrom seleniumwebdriver import ActionChainsfrom seleniumwebdr
- 在使用seleniumwire之前,需要先安装seleniumwire库。
- 在实例化ChromeOptions对象时,应使用chrome_options参数而不是chrome_options。
- 在实例化webdriver.Chrome()时,应该使用options参数而不是chrome_options。
- 在使用WebDriverWait时,应该使用self.wait而不是WebDriverWait(self.browser, 100)。
- 在with open('cookies.txt','w') as f:语句中,应该先关闭浏览器再写入cookies,否则会导致写入空的cookies。
- 在返回'success'时,应该使用return而不是print。
原文地址: https://www.cveoy.top/t/topic/b4Gd 著作权归作者所有。请勿转载和采集!