Парсинг
- 1 ответ
- 0 вопросов
0
Вклад в тег
def get_link_img(url):
response=requests.get(url,headers={'user_agent':f'{ua}'})
soap= BeautifulSoup(response.content,"html.parser")
links=soap.find_all("img",class_="serp-item__thumb justifier__thumb")
for link in links:
link = link.get("src")
linked = "https:"+str(link)
#writing to a file
name=random.random()
p = requests.get(linked)
out = open(f"Galery\{name}.jpg", "wb")
out.write(p.content)
out.close()