diff --git a/chapter2/6-regularExpressions.py b/chapter2/6-regularExpressions.py index 8a9f04a..ef12761 100644 --- a/chapter2/6-regularExpressions.py +++ b/chapter2/6-regularExpressions.py @@ -1,9 +1,9 @@ -from urllib.request -import urlopenfrom bs4 -import BeautifulSoupimport re +from urllib.request import urlopen +from bs4 import BeautifulSoup +import re html = urlopen("http://www.pythonscraping.com/pages/page3.html") bsObj = BeautifulSoup(html) images = bsObj.findAll("img", {"src":re.compile("\.\.\/img\/gifts/img.*\.jpg")}) for image in images: - print(image["src"]) \ No newline at end of file + print(image["src"])