adpro commited on
Commit
7312ff0
·
verified ·
1 Parent(s): 359e552

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ import requests
2
+ from bs4 import BeautifulSoup
3
+ page = requests.get("https://www.google.dz/search?q=see")
4
+ soup = BeautifulSoup(page.content)
5
+ import re
6
+ links = soup.findAll("a")
7
+ for link in soup.find_all("a",href=re.compile("(?<=/url\?q=)(htt.*://.*)")):
8
+ print re.split(":(?=http)",link["href"].replace("/url?q=",""))