Py学习  »  Python

为什么从Python中读取HTML不起作用?

TropicalMagic • 3 年前 • 1491 次点击  

我想使用Python Pandas Read_HTML()函数从雅虎财务表中抓取信息,如屏幕截图所示,红色边框。

enter image description here

但是,我收到了一个HTTPError:HTTP Error 404:Not Found

以下是我的代码输出:

!pip install pandas
!pip install requests
!pip install bs4
!pip install requests_html
!pip install pytest-astropy
!pip install nest_asyncio
!pip install plotly

import pandas as pd
from bs4 import BeautifulSoup
import requests
import requests_html
import nest_asyncio
import lxml
import html5lib
nest_asyncio.apply()

url_link = "https://finance.yahoo.com/quote/NFLX/history?p=NFLX%27"
read_html_pandas_data = pd.read_html(url_link)
Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/128531
 
1491 次点击  
文章 [ 2 ]  |  最新文章 3 年前