Is it possible to pull only part of the HTML page when attempting to pull HTML Data?

时间:2017-07-17 15:26:55

标签: python html json

I have pulled the HTML code from a website. But I am not sure if I have pulled it all for some reason. Can anyone help?!

import urllib.request
import re

#This requests the website URL
url = ('https://www.myvue.com/whats-on')

req = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0'})

def main():

        html_page = urllib.request.urlopen(req).read()

        content = html_page.decode(errors='ignore', encoding='utf-8')

        #data = re.findall('<span rv-text="item.title">(.*?)</span>', content)
        #print(data)

        print(html_page)
main()

0 个答案:

没有答案