python
无火的余烬sama
这个作者很懒,什么都没留下…
展开
-
selenium中遇到Message: element click intercepted
由web.find_element_by_xpath('//[@id="s_position_list"]/div[1]/div[1]/a/h3').click() 改为 button=web.find_element_by_xpath('//[@id="s_position_list"]/div[1]/div[1]/a/h3') web.execute_script("$(arguments[0]).click()",button)原创 2021-10-10 21:49:28 · 378 阅读 · 0 评论 -
selenium的环境配置
from selenium.webdriver import Chrome from selenium import webdriver import selenium #1,创建浏览器对象 selenium.webdriver.ChromeOptions.binary_location=r"D:\Chrome\Application\chrome.exe" web=Chrome() web.get("http://www.baidu.com")原创 2021-10-10 20:56:20 · 894 阅读 · 0 评论 -
爬虫的Crypto加密出现 TypeError: Object type class ‘str‘ cannot be passed to C code
要注意编码问题 iv="0000000000000000".encode("utf-8") aes=AES.new(key=key.encode("utf-8"),IV=iv,mode=AES.MODE_CBC) key和iv都要进行编码原创 2021-10-10 16:36:54 · 562 阅读 · 0 评论 -
python爬虫遇到ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。
这种情况可以用回调函数来多次访问,直到访问成功为止。 def spider(): try: 爬取 except: spider() spider()原创 2021-10-07 22:08:11 · 814 阅读 · 0 评论