0

Is there a way to get the current url using webbot? I looked at ways using os.environ, but it didn't work for me. I need the url of the page I am opening using webbot.Browser(), because some links are redirected and change.

3
  • Although the project page and documentation have more spelling errors than my dyslexic cousin's English homework, I expect you're looking for this: get_current_url() here webbot.readthedocs.io/en/latest/webbot.html - from the quality of the examples and documentation, I'd be careful to test things though. Commented Jun 17, 2019 at 4:54
  • 1
    Mental Note To Self: Read official documentations before turning to stackoverflow. P.S. Say hi to your cousin for me : ) Commented Jun 17, 2019 at 6:50
  • Probably good advice, heed yourself - SO can get snarky ;-) Commented Jun 18, 2019 at 3:23

1 Answer 1

1

you can use get_current_url(). Consider the following example:

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 )
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.