爬取没几分钟就报错了,发现知乎检测到了异常
来源:6-21 保存数据到mysql中 -3
HugoL
2019-01-08
这个时候该怎么办,要在Selenium登录的时候做if判断,做识别验证码然后填入吗,还是说有什么其他方法?
写回答
4回答
-
可以在检测到这里的时候 自动加入代码去用云打码识别这个验证码 并自动输入后继续进行
022019-01-14 -
HugoL
提问者
2019-01-16
这个是集成到scrapy里只返回空值的
这个是单独运行时可以正常识别00 -
bobby
2019-01-15
这个是我刚才分析的url请求,这里的src属性中保存了完整的base4编码, 你可以在这里获取到这个属性 然后截取出其中的base64数据,记住数据是从这里的逗号处开始的, 然后你拷贝出其中的逗号之后的所有字符串,可以这样直接保存成jpg文件:
import base64 image = "R0lGODdhlgA8AIcAAP7+/gICAujo6NfX1/Pz8xcXF8jIyCcnJ0dHR5eXl1dXV3d3d2ZmZoeHhzQ0NLe3t6enp7e3t6qqqjw8PMHBwUBAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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W3exJkT54ADAXwGWABA6FCiBgIUCJA0gAIBCAA8fQoBQoEA/1UPJCAAQOvWBAC8fgULoEAAsgEUAECbVu1atA8AvAUgIUAABQMMTJAAQO9eAAQcBFAwQAAAwoUBCIAAQPFixo0dP248YEEAypQBXMacoIABAAAGBAAdOgAA0qUTDBCA4EEEAwBcv4YdG3YDBQFsBzAAQPdu3r0FAAAePMDwAAcgOACQXHlyAQMkBGgAYAAA6tUBCACQXft27t29cx8AgYGDAgwYAECf3kEA9gIAGDgQwIGDBREiAMCfX//+/Q8AAAQgcKBAAgwCIEQYAQDDhg4dEgAgcSKABQEuFggAAQDHjhwJGAgQ4ECBAQBOogRAgACAli5fwowp86WDADZtKv8gAGDnTgMAFgQIgIAAAAgOChQAAOABgKZOn0J1KgAA1apWASAIoDXAAQBev4IFOwAA2bJlDUwI4ECAAQBu38IFIMCAAAB279pFAGAv375+/wLuKyAA4QILGCB4AGDxYgMLEBQI4CDBAAEGEDAYAGAz586eOQsAIHo0adIBTgc4AGA169arKQCILXv27AcOHBAAoHs37969IwgAIHw48eLGjxMXICCCgwAIGCAwAGD6dAMArmPPnj1ChAEAvhMAIH48AAIEAKBPr349AAYBAjwAIH8+fQAEAODPr38//gcFAC4AMJBgQYMFBwBQuJBhQ4cPIQIQkOBAAQYKDADQuJGNY0ePHwkAEDmSZEmTAAgESACAZcuWBgYAkDmTZk2bCxgIALCTZ8+eCwAEFTqUaFGjR5EmVbqUqVEIFABElRqVwAIAV7Fm1bp1a4AADSIIICDAgAAAZ9GmVbuWbVu3b+HGlTtXwYEGAgDk1buXb1+/fwEHFjyYcGHDhxEnVryYcWPHjyFHljyZcmXLiQMCADs=" fh = open("heiqie.jpeg", "wb") fh.write(base64.b64decode(image)) fh.close()
我这里的image是我现在请求到的字符串,你替换一下,你再打开文件看就能看到验证码了
022019-01-19 -
HugoL
提问者
2019-01-14
验证码的URL为base64编码的,无法请求00
相似问题