Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- elif len(keywords) == 2:
- keyword1 = keywords[0]
- keyword2 = keywords[1]
- print("Searching for product...")
- keywordLinkFound = False
- while keywordLinkFound is False:
- html = self.driver.page_source
- soup = BeautifulSoup(html, 'lxml')
- try:
- keywordLink = soup.find('image:title', text=re.compile(keyword1 + keyword2)).text
- return keywordLink
- except AttributeError:
- print("Product not found on site, retrying...")
- time.sleep(monitorDelay)
- self.driver.refresh()
- break
- <url>
- <loc>
- https://packershoes.com/products/copy-of-382-packer-x-new-era-new-york-yankee-duck-canvas-1
- </loc>
- <lastmod>2018-12-06T14:39:37-05:00</lastmod>
- <changefreq>daily</changefreq>
- <image:image>
- <image:title>
- NEW ERA JAPAN 59FIFTY NEW YORK YANKEES "DUCK CANVAS"
- </image:title>
- </image:image>
- </url>
Add Comment
Please, Sign In to add comment