Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- from bs4 import *
- import requests
- ''' This is in python 2 change raw_input to input in python 3'''
- # Only Website Name (kithnyc, justdon, minishopmadrid, etc)
- url = raw_input('Enter Shopify Website: ')
- # !! IN LOWER CASE ONLY !!
- keywords = raw_input('Keyword? ')
- def get_website():
- re_url = requests.get('http://'+url+'.com/sitemap_products_1.xml')
- text = re_url.text
- sauce = BeautifulSoup(text, 'xml')
- for urls in sauce.find_all('url'):
- for location in urls.find_all('loc'):
- for keyword in location.find_all(string=re.compile(keywords)):
- print (keyword + '\n')
- get_website()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement