0

I want to load a webpage in python and do something

import webbrowser
url = 'http://google.com'
webbrowser.open(url)
//do something

But I don't want the browser has been showed on my screen, I want to hide it so that I can do some other stuff, please give me some advices, thanks

Dark Light
  • 933
  • 1
  • 10
  • 20
  • You need a headless browser : http://stackoverflow.com/questions/6025082/headless-browser-for-python-javascript-support-required . Also look at PhantomJS (it isn't python) – user Mar 13 '14 at 05:07
  • You'll probably have to create a custom version of the `webbrowser` module based on the code in `Lib/webbrowser.py` -- or read it and try to figure-out a hack that does what you want. It's very likely to be OS dependent. – martineau Mar 13 '14 at 05:10

1 Answers1

0

In some cases, autoraise is working. Example:

    import webbrowser

    webbrowser.open('www.yoursite.com', autoraise=False)