diff --git a/app/pruebascraping.py b/app/pruebascraping.py new file mode 100644 index 0000000..0c2b75d --- /dev/null +++ b/app/pruebascraping.py @@ -0,0 +1,20 @@ +from bs4 import BeautifulSoup +import urllib.request +import re + + +def request_Flickr(keywords): + datos=urllib.request.urlopen("https://commons.wikimedia.org/w/index.php?search={keywords}&title=Special%3ASearch&go=Go&ns0=1&ns6=1&ns12=1&ns14=1&ns100=1&ns106=1").read().decode() + + return datos; + + +def scrap_Flickr(datos): + soup=BeautifulSoup(datos, features="lxml") + tag=soup.find("table", class_="searchResultImage") + images=tag.find_all("a", class_="image") + for image in images: + print(image["href"]) + + +scrap_Flickr(request_Flickr("paris"))