2

When using Python's webbrowser.open(local_webpage_url#section) the #section tag at the end of the local_webpage_url gets ignored and the browser opens the HTML page but does not navigate to the section. (The address bar also does not show the #section)

Is there special syntax or an additional navigation command that can be used to navigate to the section without using any additional modules?

SMALL UPDATE

I am linking to Sphinx documentation anchors, so that the user gets directed to the relevant section. I tried Georgy's method and the url he has worked for me as well, but my local url is just directing to the page, not the anchor.

Barus
  • 101
  • 14
  • 2
    I can't reproduce the issue. The following works fine for me: `webbrowser.open('https://docs.python.org/library/webbrowser.html#webbrowser.open', new=2)` – Georgy Feb 26 '19 at 08:35
  • Maybe the anchors are generated dynamically? –  Feb 26 '19 at 09:04
  • I am linking to Sphinx documentation anchors, so that the user gets directed to the relevant section. I tried Georgy's method and the url he has worked for me as well, but my local url is just directing to the page, not the anchor. – Barus Feb 26 '19 at 09:45
  • 1
    I think you should add this info to your post, and add the tag for python-sphinx, so that people who work with it will see your question. – Georgy Feb 26 '19 at 10:04

0 Answers0