Vasily
Vasily

Reputation: 2514

Get URL from active tab using python

Is there a way to get an html for active tab in browser (Firefox in my case) without using selenium?

Similar topics were raised before, but there were no clear answers.

Upvotes: 0

Views: 845

Answers (1)

Allen Fernandes
Allen Fernandes

Reputation: 1353

You could use the following code to get the source.For parsing use python library such as Beautiful Soup

import urllib2

response = urllib2.urlopen("http://google.com")
page_source = response.read()
print page_source`

Upvotes: 1

Related Questions