[Tutor] Get image url

Alan Gauld alan.gauld at yahoo.co.uk
Thu Aug 6 19:46:26 EDT 2020


On 07/08/2020 00:34, André Pinto wrote:
> How can I get the web site url address using web scraping if I have the
> image tag?

I assume you mean the url of the image rather than the url of the host
web site(since you presumably have that to scrape in the first place?)

Which web scraper/parser are you using? If it is BeautifulSoup then
getting the url from the img tag should be a simple lookup:

https://www.crummy.com/software/BeautifulSoup/bs4/doc/#attributes

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list