Beautiful Soup: 'ResultSet' object has no attribute 'find_all'?

前端 未结 3 1609
说谎
说谎 2020-11-22 05:27

I am trying to scrape a simple table using Beautiful Soup. Here is my code:

import requests
from bs4 import BeautifulSoup

url = \'https://gist.githubusercon         


        
3条回答
  •  忘了有多久
    2020-11-22 06:10

    The table variable contains an array. You would need to call find_all on its members (even though you know it's an array with only one member), not on the entire thing.

    >>> type(table)
    
    >>> type(table[0])
    
    >>> len(table[0].find_all('tr'))
    6
    >>>
    

提交回复
热议问题