Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/300.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Python和webbot获取当前URL_Python_Url_Web Scraping_Webbot - Fatal编程技术网

使用Python和webbot获取当前URL

使用Python和webbot获取当前URL,python,url,web-scraping,webbot,Python,Url,Web Scraping,Webbot,有没有办法使用webbot获取当前url? 我研究了使用os.environ的方法,但它对我不起作用。 我需要使用webbot.Browser()打开的页面的url,因为某些链接被重定向和更改 您可以使用get\u current\u url()。 考虑下面的例子: from webbot import Browser web = Browser() url = 'something.com' # site name web.go_to(url) ... #your code webbot_re

有没有办法使用webbot获取当前url? 我研究了使用
os.environ
的方法,但它对我不起作用。
我需要使用
webbot.Browser()
打开的页面的url,因为某些链接被重定向和更改

您可以使用get\u current\u url()。 考虑下面的例子:

from webbot import Browser
web = Browser()
url = 'something.com' # site name
web.go_to(url)
... #your code
webbot_result_url = web.get_current_url()
print(webbot_result_url )

虽然项目页面和文档中的拼写错误比我有阅读障碍的表弟的英语作业多,但我希望你能找到以下内容:
get\u current\u url()
here-从示例和文档的质量来看,不过,我还是会小心地进行测试。赛尔夫的心理提示:在转向stackoverflow之前,先阅读官方文件。请代我向你的表弟问好:)也许是个好建议,你自己留心吧——这样你就可以发牢骚了;-)