从具有大量空白区域的源提取数据

时间:2010-06-03 12:28:59

标签: csv screen-scraping text-processing

我正在尝试从http://www.phillysheriff.com/old_site/properties.html

中提取数据

理想情况下,我可以获得包含地址,病房,价格和平方英尺的CSV文件吗?有一个简单的方法吗?

2 个答案:

答案 0 :(得分:1)

从网页中提取这样的信息的过程通俗地称为“刮擦”。如果是我,我会使用python语言和"Beautiful Soup"包来完成它。然而,谷歌的“屏幕刮”或“网页刮”和你最喜欢的编程语言应该找到一个能为你付出辛勤劳动的包。

答案 1 :(得分:0)

您可以运行IRobotSoft Web scraper,在其浏览器窗口中打开该页面,然后使用菜单:Design - >练习HTQL。在输入框中提供以下HTQL查询,以将页面转换为标准HTML表:

<hr sep>2-0{
a=<center>1 &tx &trim;
b=<center>1:xx ./'nbsp'/1 &tx &trim('&; ');
c=<center>1:xx ./'nbsp'/3 ./'\n'/1 &tx &trim('&; ');
d=<center>1:xx ./'nbsp'/3 ./'Ward'~'BRT#'/1 &tx;
e=<center>1:xx ./'nbsp'/3 ./'BRT#'~'Improvements:'/1 &tx;
f=<center>1:xx ./'nbsp'/3 ./'Improvements:'/2 &tx;
g=<br sep>2. /'nbsp'/1 &tx &trim('&; ');
h=<br sep>2. /'nbsp'/3 &tx &trim('&; '); 
i=<br sep>2. /'nbsp'/5 &tx &trim('&; ');
j=<br sep>2. /'nbsp'/7 &tx &trim('&; ');
}