Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- from urllib.request import urlopen
- url = 'https://www.amazon.com.au/gp/rss/bestsellers/electronics'
- html_code = urlopen(url)
- code = html_code.read().decode('UTF-8')
- html_code.close()
- variables = re.findall('\<\div class\=\"\col search_price responsive_secondrow\"\>\(.*?)\<\/\div\>\'',code)
- print(variables)
- """
- start_tag = '<title><![CDATA['
- end_tag = ']]></title>'
- starting_position = code.find(start_tag)
- end_position = code.find(end_tag)
- while starting_position != -1 and end_position != -1:
- print(code[starting_position + len(start_tag): end_position])
- starting_position = code.find(start_tag, end_position)
- end_position = code.find(end_tag, starting_position)
- """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement