Python Collection of problems seen by crawler :

1. NotImplementedError: Only the following pseudo-classes are implemented:
nth-of-type

Answer:nth-child Change to nth-of-type

3.expected string or bytes-like object:

Answer: Code conversion .

eg:re.findall(r’’,html.decode(‘utf-8’))

4. 'gbk' codec can't encode character '\xa5' in position 184823: illegal
multibyte sequence

Answer:f = open(html,’w’,encoding = ‘utf-8’)

5.  Web page garbled problem : Chinese random code

Answer :response = requests.get(url,headers = header).content

#content Solve the garbled code

6. expected string or bytes-like object

Answer: Convert to string format ,str(urls)

urls = soup.select(' div > div.nei_left.fl > ul > li:nth-of-type(2)> a')[0]

Href = re.findall(r'<a href="(.*?)" target="" title=".*?">(.*?)</a>',str(urls))

7.  Raise URLError (err)  <urlopen error [Errno 11001] getaddrinfo failed>

usually ,URLError There is no network connection at ( There is no routing to a specific server ), Or when the server does not exist

Technology
©2020 ioDraw All rights reserved
Python Basic course of programming and algorithm Chapter 4 computer problems vue-cli Installation configuration in sassJAVA Implement simple section annotation pytorch torchvision.transforms.Normalize() In mean and std parameter --- Dispelling doubts 【Vue Easy to get started 】 Value transfer between parent and child components Oracle2021 Annual safety warning ,8 There are two security vulnerabilities that need attention C Language life game source code element-ui/vue-element-admin upload excel Wait for the file to go to the server The 11th Blue Bridge Cup b group pandas The best function in data processing apply+lambda