Aru*_*hit 8 python selenium beautifulsoup selenium-webdriver
我正在使用python2.7 beautiful Soup4 and Selenium webdriver.现在在我的webautomation脚本中,我将打开链接或URL并进入主页.现在我需要点击一些anchor Labels来浏览其他页面.我到现在为止.现在,当我要进入新页面时,我需要URL从浏览器中获取新内容,因为我需要将其传递Beautiful Soup4给网页抓取.所以现在我关注的是如何以动态的方式获得这样的URL?
如果有的话请建议!
Bou*_*oud 17
你获得current_url了驱动程序的属性:
from selenium import webdriver
browser = webdriver.Firefox()
browser.get('http://www.google.com')
print browser.current_url
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9189 次 |
| 最近记录: |