我不知道如何获取以下CSS路径下的html内容:
html body div table tbody tr td.outline div#content_outer div#content_inner table.content_table tbody tr td table.content_table tbody tr td.body_outer table
下面的代码不起作用:
import requests, time, re, pymysql, datetime
from bs4 import BeautifulSoup
from datetime import timedelta
try:
page_address = "http://<my_page>"
page = requests.get(page_address)
except requests.ConnectionError:
print("Connection Error")
soup = BeautifulSoup(page.content, 'html.parser')
content = soup.select('html body div table tbody tr td.outline div#content_outer div#content_inner table.content_table tbody tr td table.content_table tbody tr td.body_outer table')
print(content)
可以帮忙吗?