0

I am able to open an html file using the code

import webbrowser
webbrowser.open_new_tab('file:///C:/filename.html')

The issue I am facing is opening the same html file but with a hyperlink.

webbrowser.open_new_tab('file:///C:/filename.html#hyperlinkId')

This opens the file in the browser tab but does not move to the hyperlink as required.

Kindly let me know if I am missed anything. Thanks in advance.

Bhavesh Patadiya
  • 25,740
  • 15
  • 81
  • 107
  • @VipinJoshi:The mentioned link just has the option to open the html file in the browser which is working for me as well. The issue is with moving to the hyperlink. – Aarti Singh Apr 17 '18 at 10:05
  • @VipinJoshi The question already uses a URL, so I don't really get what you want to say with your comment. Also your example doesn't contain an anchor. – BlackJack Apr 19 '18 at 16:38

0 Answers0