Created
April 8, 2017 11:21
-
-
Save jayapal/195b4fc0f9842d812917ec3287d1bfe8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
def get_image_url(purchase_url): | |
""" | |
Method to get HTML content from Lowes store and return product image | |
@params purchase_url : product url | |
@outpout : img url | |
""" | |
html = requests.get(purchase_url).text | |
soup = BeautifulSoup(html) | |
img_el = soup.find('img',{'class':'product-image pd-epc'}) | |
if img_el: | |
return img_el['src'] | |
return None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment