Selenium - Python - 获取验证码 Url(从生成的链接)
Python - Selenium / urllib2
我需要获取下载验证码图像的 url。
图像代码:img src =“ generatedlink”
我需要将这个“ generatedlink”解析为变量
variable =“ generatedlink”
有没有办法用selenium或urllib2得到这个?
(我可以使用 urllib.retrieve (手动)将生成的链接传输到 local.jpg 文件中,但我无法执行第一步(自动获取链接并将其放入变量中)。)
谢谢您提供的任何信息
Python - Selenium / urllib2
I need to get the url to download a captcha image.
Image code : img src = "generatedlink"
I need to parse this "generatedlink" into a variable
variable = "generatedlink"
Is there a way to get this with selenium or urllib2 ?
( I am able to transfer my generated link into local.jpg file with urllib.retrieve (manually) but i cant do the first step ( get the link automatically and put it into variable) .)
Thank you for any info
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用的是 selenium 2,则可以这样做,此示例通过 xpath 引用它:
If you are using selenium 2 this is how you would do it, this example references it by xpath:
如果您使用 Python,则应执行以下操作:
If you are working with Python, the following should do: