Python初学者,请帮帮忙,下面几行代码:
def get_links(url):
resp = request.get(url)
soup = bs.BeautifulSoup(resp.text, 'lxml')
body = soup.body
在 soup = bs.BeautifulSoup(resp.text, 'lxml') 语句中,‘BeautifulSoup’ 是一个class并且可以在bs4的文件(__init__.py)中看到相应代码。
但是在 body = soup.body 语句中,这个‘.body’ 是函数吗? 我在bs4文件(__init__.py)中搜索不到对应的‘详细代码’
此外还有 '.find_all( )' , '.get( )' 等等这些,为何在bs4(__init__.py)文件中搜不到? 而且在Python的内置函数中我也没搜索到。
怎么回事?