2
[BeautifulSoup] Getting blank contents when trying to scrape a table on a site?
Author Summary
plytheman is
in
BeautifulSoup
Post Body
I've been trying to grab the contents of a table so I can save them as a CSV but for some reason when I list the contents I end up with blanks. There are 17 <td> tags per <tr>, but when I call the length of the row I get 35, and when I print there are blanks between each <td>. Not sure how else to describe it than that but the source, code, and results are here: Gist
Also tried to put the source html last but GitHub threw it on top, but if you scroll down you'll get to my script and results.
I'm pretty new to BS so I'd assume there's something obvious I'm missing. Ultimately I'm just trying to re-create the table row-for-row as a csv.
Thanks!
Author
Account Strength
100%
Account Age
16 years
Verified Email
Yes
Verified Flair
No
Total Karma
24,663
Link Karma
4,393
Comment Karma
20,260
Profile updated: 4 days ago
Posts updated: 10 months ago
Subreddit
Post Details
Location
We try to extract some basic information from the post title. This is not
always successful or accurate, please use your best judgement and compare
these values to the post title and body for confirmation.
- Posted
- 6 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/learnpython...