Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Python to Access Web Data_Coursera_Notes_Ch13_WebServices_BeautifulSoup #12

Open
fairypp opened this issue Jul 2, 2016 · 1 comment

Comments

@fairypp
Copy link
Owner

fairypp commented Jul 2, 2016

import urllib
from bs4 import BeautifulSoup
#from BeautifulSoup import *

url = raw_input('Enter - ')

html = urllib.urlopen(url).read()
soup = BeautifulSoup(html)

# Retrieve a list of the anchor tags
# Each tag is like a dictionary of HTML attributes

tags = soup('a')

for tag in tags:
    print tag.get('href', None)
@fairypp fairypp changed the title Python Data Structures_Coursera_Notes_Ch13_WebServices_BeautifulSoup Using Python to Access Web Data_Coursera_Notes_Ch13_WebServices_BeautifulSoup Jul 18, 2016
@sheersh2001
Copy link

cc
i am getting this trace back. can you help me out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants