HawkeyeHS commited on
Commit
095d14f
·
1 Parent(s): af6441c

Add extract image endpoint

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -28,10 +28,10 @@ def extract_images():
28
  try:
29
  src=request.args.get("src")
30
  response = requests.get(src)
31
- soup = BeautifulSoup(response.text, 'html.parser')
32
  img_urls=[]
33
 
34
- img_tags = soup.find_all('img')
35
  for img_tag in img_tags:
36
  img_url = img_tag['src']
37
  img_urls.append(img_url)
 
28
  try:
29
  src=request.args.get("src")
30
  response = requests.get(src)
31
+ soup = BeautifulSoup(response.content,'html.parser')
32
  img_urls=[]
33
 
34
+ img_tags = soup.select('div img')
35
  for img_tag in img_tags:
36
  img_url = img_tag['src']
37
  img_urls.append(img_url)