Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add 7th example to chapter2
  • Loading branch information
will-i-amv authored Jun 30, 2021
commit 1e8db8830f3a1826bf6163c0188d5df8cde0b0ab
10 changes: 10 additions & 0 deletions v2/chapter2/7-lambdaExpressions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

from urllib.request import urlopen
from bs4 import BeautifulSoup


html = urlopen("http://www.pythonscraping.com/pages/page2.html")
bsObj = BeautifulSoup(html, "html.parser")
tags = bsObj.findAll(lambda tag: len(tag.attrs) == 2)
for tag in tags:
print(tag)