pyquery url初始化

#url初始化
from pyquery import PyQuery as pq
doc = pq(url='http://www.taobao.com')
print(doc('head'))
'''
输出结果:
"utf-8"/>
"X-UA-Compatible" content="IE=edge,chrome=1"/>
"renderer" content="webkit"/>
淘宝网 - 淘!我喜欢
"spm-id" content="a21bo"/>
"description" content="淘宝网 - 亚洲较大的网上交易平台,提供各类服饰、美容、家居、数码、话费/点卡充值… 数亿优质商品,同时提供担保交易(先收货后付款)等安全交易保障服务,并由商家提供退货承诺、破损补寄等消费者保障服务,让你安心享受网上购物乐趣!"/>
"aplus-xplug" content="NONE"/>
"keyword" content="淘宝,掏宝,网上购物,C2C,在线交易,交易市场,网上交易,交易市场,网上买,网上卖,购物网站,团购,网上贸易,安全购物,电子商务,放心买,供应,买卖信息,网店,一口价,拍卖,网上开店,网络购物,打折,免费开店,网购,频道,店铺"/>
"dns-prefetch" href="//g.alicdn.com"/>
"dns-prefetch" href="//img.alicdn.com"/>
"dns-prefetch" href="//tce.alicdn.com"/>
"dns-prefetch" href="//gm.mmstat.com"/>
ref="dns-prefetch" href="//tce.taobao.com"/>
"dns-prefetch" href="//log.mmstat.com"/>
"dns-prefetch" href="//tui.taobao.com"/>
"dns-prefetch" href="//ald.taobao.com"/>
"dns-prefetch" href="//gw.alicdn.com"/>
"dns-prefetch" href="//atanx.alicdn.com"/>
"dns-prefetch" href="//dfhs.tanx.com"/>
"dns-prefetch" href="//ecpm.tanx.com"/>
"dns-prefetch" href="//res.mmstat.com"/>
"//img.alicdn.com/tps/i3/T1OjaVFl4dXXa.JOZB-114-114.png" rel="apple-touch-icon-precomposed"/>

<base target="_blank"/>


'''

 

转载于:https://www.cnblogs.com/liangliangzz/p/10272609.html

你可能感兴趣的:(pyquery url初始化)