python如何在解析HTML页面时,对里面的JS代码中的内容进行提取
例如下面是网页中的JS代码,如何把代码中的URL提取出来,网页的URL是:guangzhou.wxcs.cn/nav/navCity?areaCode=440100
function LetterStorage(){
this.letterJson = {
"A" : [ {link:"http://guangzhou.wxcs.cn/nav/toCity?url=http://aba.wxcs.cn/&areacode=513200",name:"阿坝"} , {link:"http://guangzhou.wxcs.cn/nav/toCity?url=http://akesu.wxcs.cn/&areacode=652900",name:"阿克苏"} , {link:"http://guangzhou.wxcs.cn/nav/toCity?url=http://alashan.wxcs.cn/&areacode=152900",name:"阿拉善"} , {link:"http://guangzhou.wxcs.cn/nav/toCity?url=http://aletai.wxcs.cn/&areacode=654300",name:"阿勒泰"} , {link:"http://guangzhou.wxcs.cn/nav/toCity?url=http://ankang.wxcs.cn/&areacode=610900",name:"安康"} , {link:"http://guangzhou.wxcs.cn/nav/toCity?url=http://anqing.wxcs.cn/&areacode=340800",name:"安庆"} , {link:"http://guangzhou.wxcs.cn/nav/toCity?url=http://anshan.wxcs.cn/&areacode=210300",name:"鞍山"} , {link:"http://guangzhou.wxcs.cn/nav/toCity?url=http://anshun.wxcs.cn/&areacode=520400",name:"安顺"} , {link:"http://guangzhou.wxcs.cn/nav/toCity?url=http://anyang.wxcs.cn/&areacode=410500",name:"安阳"} , {link:"http://guangzhou.wxcs.cn/nav/toCity?url=http://atushi.wxcs.cn/&areacode=653000",name:"阿图什"} ],"B" : [ {link:"http://guangzhou.wxcs.cn/nav/toCity?url=http://baicheng.wxcs.cn/&areacode=220800",name:"白城"} , {link:"http://guangzhou.wxcs.cn/nav/toCity?url=http://baise.wxcs.cn/&areacode=451000",name:"百色"} , {link:"http://guangzhou.wxcs.cn/nav/toCity?url=http://baisha.wxcs.cn/&areacode=469025",name:"白沙"} ,
...全文
相关推荐
扒js处理过的HTML代码.反爬手段之一就是用javascript数据渲染到页面上.所以如果你想写个反反爬虫来扒这样的网站页面,就按我这办法来扒.
扒js处理过的HTML代码 我在之前的爬虫资源里讲过了,反爬手段之一就是用javascript数据渲染到页面上.所以如果你想写个反反爬虫来扒这样的网站页面,就按我这办法来扒.
Phantomjs抓取渲染JS后的网页(Python代码)
phantomjs:我的理解就是它是一个无显示的浏览器,也就是说除了不能显示页面内容以外,浏览器能干的活儿它基本上都能干。下面我们就来利用他做点有趣的事情
unfluff-lambda:AWS Lambda函数从网页提取HTML(使用unfluff)
Unfluff-lambda AWS lambda函数从网页提取HTML(使用unfluff)。
python:关于Python的一些代码
python 关于Python爬虫的一些代码 爬取豆瓣电影top250,以及summary,并使用D3生成可交互的词云
python 爬虫学习测试样例 包含逆向js,Selenium框架等
python 爬虫学习测试样例 包含逆向js,Selenium框架等


