Created
February 26, 2014 16:10
-
-
Save codesynapse/9232634 to your computer and use it in GitHub Desktop.
How to extract URL from HTML Page using BeautifulSoup Python Library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup | |
import requests | |
url= raw_input("Enter the search query :"); | |
re=requests.get("http://"+url); | |
data = re.text | |
soup = BeautifulSoup(data) | |
for link in soup.find_all('a'): | |
print(link.get('href')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment