webbrowser fragment identifier

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Fri Sep 19 12:14:48 CEST 2008

En Thu, 18 Sep 2008 21:53:22 -0300, scottbvfx <scotballard at gmail.com>  

> I'm trying to launch a web browser along with an html file with a
> fragment identifier in its path. I'm using the webbrowser module for
> this.
> ie. webbrowser.open('file:///C:/myfile.html#SomeEntryInTheHTML')
> for some reason it is truncating the path to 'file:///C:/myfile.html'.
> Does anyone know a way of getting the fragment identifier in there
> (with webbrowser module or any other)?

It's not Python which truncates the path - webbrowser.open doesn't modify  
the url given.
Looks like you're on Windows. Internet Explorer exposes a COM interface  
that you may use to control it. Google for "python IE automation"

Gabriel Genellina

More information about the Python-list mailing list