I am trying to use BeautifulSoap for the first time, I am trying to extract image form a site but I am getting it a link which when opened is blur, i have an extension as a scraper as well and when i tried with that the image was clear, Here is the code
from bs4 import BeautifulSoup
import requests
//target declared and intialized
html_text = requests.get(target).text
soup = BeautifulSoup(html_text,'lxml')
head = soup.find('div',class_="catalog-grid__results")
pk = head.find('ol',class_="list-no-style margin-bottom-large course-list")
coursess = pk.find_all('li',class_="bg-white border-all border-gray-light padding-xsmall radius-small margin-bottom-small medium-up-padding-horz-large medium-up-padding-vert-medium course-list-course")
for courses in coursess:
checkimageurl = courses.find('img',class_="absolute top left width-100 height-100 cover block")
print(checkimageurl)
print()
Link I am getting are like these : https://ccweb.imgix.net/https%3A%2F%2Fd3f1iyfxxz8i1e.cloudfront.net%2Fcourses%2Fcourse_image%2F70c39ca46b59.jpg?auto=format&blur=200&cs=strip&fit=crop&h=380&ixlib=php-3.3.0&px=16&w=535&s=aba329225fc4488ea52ef6880275591f
While the scraper in extension and sources of site has this: https://ccweb.imgix.net/https%3A%2F%2Fd3f1iyfxxz8i1e.cloudfront.net%2Fcourses%2Fcourse_image%2Fd3c143b4409a.jpg?ar=16%3A9&auto=format&cs=strip&fit=crop&h=380&ixlib=php-3.3.0&w=535&s=2fc8a778f45f0479d724d423f4fdb016
Aucun commentaire:
Enregistrer un commentaire