这样的报错是什么意思?该如何解决?

line20涉及代码:
def scrach(url):
html=requests.get(url)
selector=etree.HTML(html.text)
webb=selector.xpath('/html/body')
dict_1={}
for info in webb:
webb_name=selector.xpath('//[@id="j_p_postlist"]')
author=webb_name['webb_name']['author_n']
web_content=selector.xpath('//
[@id="post_content_88796553069"]/text()')
content=web_content['web_content']['content_n']
print(author)
print(content)
dict_1['author_n']=author
dict_1['content_n']=content
documents(dict_1)
终端报错内容:
Traceback (most recent call last):
File "c:/Users/Administrator.DESKTOP-MP1O82P/Desktop/py/scrach/Xpath-final.py", line 43, in
results=pool.map(scrach,page)
File "C:\Users\Administrator.DESKTOP-MP1O82P\AppData\Local\Programs\Python\Python38\lib\multiprocessing\pool.py", line 364, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "C:\Users\Administrator.DESKTOP-MP1O82P\AppData\Local\Programs\Python\Python38\lib\multiprocessing\pool.py", line 771, in get
raise self._value
File "C:\Users\Administrator.DESKTOP-MP1O82P\AppData\Local\Programs\Python\Python38\lib\multiprocessing\pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "C:\Users\Administrator.DESKTOP-MP1O82P\AppData\Local\Programs\Python\Python38\lib\multiprocessing\pool.py", line 48, in mapstar
return list(map(*args))
File "c:/Users/Administrator.DESKTOP-MP1O82P/Desktop/py/scrach/Xpath-final.py", line 20, in scrach
author=webb_name['webb_name']['author_n']
TypeError: list indices must be integers or slices, not str

TypeError: list indices must be integers or slices, not str
报错原因是 列表的索引必须是int类型,你给的是字符串
解决方法:检查一下webb_name是个列表 还是webb_name['webb_name']是个列表,用索引取列表值

提示意思是list的索引必须是整数或者片,而不是str

webb_name=selector.xpath('//[@id="j_p_postlist"]')
author=webb_name['webb_name']['author_n']

得到的是列表,需要通过索引获取内容。

TypeError:对类型无效的操作;类型错误, str的字符串类型无效