When I write about a crawler today, I encounter a pit and prompt [scratch. Core. Scraper] error: spider must return request, item, or none, got ‘tag’ in & lt; GET https://www.
In fact, the reason is very unexpected. I use item in the code, and at the same time, the scratch uses item to pass data. As a result, this problem is caused
for item in soup.select(".job-list-item"): uu=item.select_one("a").get('href').split("?")[0] if uu is not None: item['wz']=uu yield item
If you change yield to return, no error will be reported, but the data cannot be transferred. You need to change it to the following code
for itema in soup.select(".job-list-item"): uu=itema.select_one("a").get('href').split("?")[0] if uu is not None: item['wz']=uu yield item
Similar Posts:
- [Solved] ant Error: Cannot use ‘in’ operator to search for ‘value’ in undefined
- [Solved] Operator overload must take either zero or one argument error
- AttributeError: ‘list’ object has no attribute ‘keys’
- How to Solve Error: Cannot read property ‘map’ of undefined
- ValueError: day is out of range for month [How to Solve]
- [leetcode] 140. Word break II word split II
- Vue3 vue.draggable slot jsx Error: Error: draggable element must have an item slot
- [Solved] Python Error: a bytes-like object is required, not ‘str’
- Each child in an array or iterator should have a unique “key” prop. Check the render method of `Tabl
- ValueError: day is out of range for month [How to Solve]