Football betting information website of crawling and analysis of information

Explanation

A. Projects

Crawling football quiz page for information and analysis of information

II. Shows part of the code

import requests
from lxml.html import etree

headers = {'Referer': 'http://www.okooo.com/jingcai/',
           'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36'}

url = 'XXXXXXXXXXX'
response = requests.get(url, headers=headers)
response.encoding = response.apparent_encoding
response_html = etree.HTML(response.text)

id_xpath = '//*[@class="touzhu_1"]/@data-mid'
hname_xpath = '//*[@class="touzhu_1"]/@data-hname'
aname_xpath = '//*[@class="touzhu_1"]/@data-aname'

id_list = response_html.xpath(id_xpath)
hname_list = response_html.xpath(hname_xpath)
aname_list = response_html.xpath(aname_xpath)

III. For the complete code compressed folder

Project link: https: //github.com/a568972484/Crawl_for_football_infor

As for the core dynamic code is also compressed folder

Needs please contact the author

Author: a568972484

On the blog: small salted fish ywy

Blog linkhttps://www.cnblogs.com/pythonywy

Guess you like

Origin www.cnblogs.com/pythonywy/p/11209323.html