Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/301.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python,将html表转换为数据框架_Python_Dataframe_Beautifulsoup_Html Parsing - Fatal编程技术网

Python,将html表转换为数据框架

Python,将html表转换为数据框架,python,dataframe,beautifulsoup,html-parsing,Python,Dataframe,Beautifulsoup,Html Parsing,我试图使用parser.make2d函数将html表转换为可用的数据帧,但我无法安装parser.make2d模块。 在我的Python2.7中,它找不到“html\u table\u parser”模块,因此“from html\u table\u parser import parser\u functions as parse”不起作用 from urllib2 import urlopen import pandas as pd from bs4 import BeautifulSoup

我试图使用parser.make2d函数将html表转换为可用的数据帧,但我无法安装parser.make2d模块。 在我的Python2.7中,它找不到“html\u table\u parser”模块,因此“from html\u table\u parser import parser\u functions as parse”不起作用

from urllib2 import urlopen
import pandas as pd
from bs4 import BeautifulSoup
import webbrowser
import requests
from html_table_parser import parser_functions as parse

report = requests.get(url_parsing, proxies = proxies)
report2 = BeautifulSoup(report.text,'html.parser')
body=report2.find("body")
table=body.find_all("table")
p = parser.make2d(table[3])

似乎没有安装html_table_解析器模块

你试过跑步吗

python -m pip install html_table_parser

在命令行上?

您是如何下载库的?使用pip?我目前正在使用pycharm 2017.2以前没有使用过pycharm,但这会有帮助吗?不,html_表_解析器不在那里,找不到模块