I am scraping data from one site, and I need to find one img. I get it but the output is not what I need.
I have tried looking online for solutions, changing code but nothing worked.
r = requests.get(baseurl)
content = r.content
soup = BeautifulSoup(content, "html.parser")
images = soup.findAll('img')[1]
print(images)
Output I get:
<img src="https://cdn.rubyrealms.com/images/WKpivrdGBJJ9p6etIY2aJpixikFj4vnpmpPR9pXjK4Y8K.png" style="border-radius: 5px"/>
Output I need:
cdn.rubyrealms.com/images/WKpivrdGBJJ9p6etIY2aJpixikFj4vnpmpPR9pXjK4Y8K.png
(I tried print(images.text))
srcattribute from your<img>elementimages.get('src')