Skip to content

Commit 15744a5

Browse files
committed
adicionando codes capitulo 2
1 parent df4780b commit 15744a5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from urllib.request import urlopen
2+
from bs4 import BeautifulSoup
3+
print()
4+
html = urlopen('http://www.pythonscraping.com/pages/page1.html')
5+
bs = BeautifulSoup(html.read(), 'html.parser')
6+
nameList = bs.findAll('span', {'class': 'green'})
7+
8+
for name in nameList:
9+
print(name.get_text())

0 commit comments

Comments
 (0)