level 1
生化危机☎
楼主
1、待采集网站:爱词霸
url: http://www.iciba.com
测试网址:http://www.iciba.com/test
测试代码:
import urllib
def getHtml(url):
page = urllib.urlopen(url)
html = page.read()
return html
html = getHtml("http://www.iciba.com/test")
print html
2、待采集关键字(关键字存放在文件中)
文件名称:key.txt
3、采集结果形式
每个关键字存放到一个文件中,样例:关键字-result.txt
4、网页信息解析
抽取网页中词典信息内容,并按照指定格式存放到文件中。
结果样例:
【关键字】test
【音标】英 [test] 美 [test]
【解释信息】n.试验; 考验; 测验; 化验
vt.测验; 考查; 考验; 勘探
vi.受试验; 受测验; 受考验; 测得结果
【网络释义】
测试;试验;考试;检验
【词性变换】
复数: tests 过去式: tested 过去分词: tested 现在分词: testing 第三人称单数: tests
派生词:testability testable testee
2015年08月03日 02点08分
1
url: http://www.iciba.com
测试网址:http://www.iciba.com/test
测试代码:
import urllib
def getHtml(url):
page = urllib.urlopen(url)
html = page.read()
return html
html = getHtml("http://www.iciba.com/test")
print html
2、待采集关键字(关键字存放在文件中)
文件名称:key.txt
3、采集结果形式
每个关键字存放到一个文件中,样例:关键字-result.txt
4、网页信息解析
抽取网页中词典信息内容,并按照指定格式存放到文件中。
结果样例:
【关键字】test
【音标】英 [test] 美 [test]
【解释信息】n.试验; 考验; 测验; 化验
vt.测验; 考查; 考验; 勘探
vi.受试验; 受测验; 受考验; 测得结果
【网络释义】
测试;试验;考试;检验
【词性变换】
复数: tests 过去式: tested 过去分词: tested 现在分词: testing 第三人称单数: tests
派生词:testability testable testee