Stock Liao information

— Basic knowledge of stocks|Introduction to basics of stocks|Stock learning|Basic knowledge of stocks
Mobile access:m.liaochihuo.com

How can I crawl the results announcement of the CSRC's public development review committee meeting?

Release Time:2021-07-10 Topic:Latest Announcement of the Securities Regulatory Commission Issuing Review Committee Reading:16 Navigation:Stock Liao information > Education > How can I crawl the results announcement of the CSRC's public development review committee meeting? phone-reading

I tried two methods but failed to get it. I don’t know if it’s the webpage setting or the code problem. I’m asking for answers.

Try 1:

import re

from bs4 import BeautifulSoup

res _ public = re.get('')

headers = (

'origin':'',

'referer':'',

'user-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.104 Safari/537.36',

}

# Analyze data

bs _ public = BeautifulSoup(res _ public .text,'html.parser')

# Find the smallest parent tag

list _ publics = bs _ public.find _ all('li',class _ ='mc')

print(list _ publics)

# Create an empty list to store information

list _ all = []

for publish in list _ publics:

# Extract the 0th parent tag The tags in

tag _ a = publish.find _ all('a')

# Announcement name, use the strip() function to remove extra spaces

name = tag _ a.text.strip()

# Get URL

if'Announcement of Conference Review Results' in name:

URL = tag _ a['href' ]

Print(URL)

# Extract the 0th parent tag The

tag

res _ p = re.get(URL)

bs _ p = BeautifulSoup(res _ p.text,'html.parser')

list _ p = bs _ p .find _ all('p',class _ ='content ')

# Announcement, use the strip() function to remove extra spaces

brief = list _ p.text.strip()

list _ ([ name,URL,brief ])

# Print

print(list _ all)

Try 2: driver = webdriver.Ie()

driver.get('')

time.sleep(5)

driver.find _ element _ by _ tag _ name('documentContainer').find _ elements _ by _ class _ name('mc')

Article Url:https://www.liaochihuo.com/info/604987.html

Label group:[url

Hot topic

Education recommend

Education Popular