(二)python爬虫urllib库的基本使用及了解第一小节

本文介绍了Python3中的urllib库,用于HTTP请求。讲解了如何利用urllib请求网页并获取源码,以及使用urlretrieve方法保存网页到本地。还讨论了URL编码与解码的重要性,并展示了编码和解码的过程。
摘要由CSDN通过智能技术生成

urllib库是python官方提供的一个http请求库,在python3中的urllib库其实是把python2里的urllib库和urllib2整合在一起的.我们这里主要说的就是python3

首先开发环境:

系统: windows10

开发语言: Python3

IDE: pytharm


东西都准备好了就进入我们今天的主题.


如何使用urllib快速的请求一个网站并且获得网站的源码,

import urllib.request # 首先,从urllib库中导入内置函数request

'''
在这里给大家解释一下什么是url?
url是Uniform Resource Locator的简写
代表的含义就是统一资源定位符(就是平时我们称之为网址的东西).
那什么是统一资源定位符?
统一资源定位符是统一资源标志符的一个下种。统一资源标志符确定一个资源,而统一资源定位符不但确定一个资源,而且还表示出它在哪里。
'''

url = 'http://www.baidu.com'
html = urllib.request.urlopen(url) # urllib库中提供了一个request函数用urlopen的方法打开我们网址,并且赋值给html
html_content = html.read()# 返回的数据,用read方法读取里面的内容(内容其实是一个很长的字符串),并且用html_conten变量保存为一个对象
print(html.readline())# 因为我们的真实网页其实是有结构的,所以我们也可以通过readline方法来读取一行数据
print(html_content) # 打印以想我们读取出来的内容

执行结果:

b''
b'<!DOCTYPE html>\n<!--STATUS OK-->\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\r\n        \r\n\t\t\t        \r\n\t\r\n\t\t\t        \r\n\t\r\n\t\t\t        \r\n\t\r\n\t\t\t        \r\n\t\t\t    \r\n\r\n\t\r\n        \r\n\t\t\t        \r\n\t\r\n\t\t\t        \r\n\t\r\n\t\t\t        \r\n\t\r\n\t\t\t        \r\n\t\t\t    \r\n\r\n\r\n\r\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\n\n<html>\n<head>\n    \n    <meta http-equiv="content-type" content="text/html;charset=utf-8">\n    <meta http-equiv="X-UA-Compatible" content="IE=Edge">\n\t<meta content="always" name="referrer">\n    <meta name="theme-color" content="#2932e1">\n    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />\n    <link rel="search" type="application/opensearchdescription+xml" href="/content-search.xml" title="\xe7\x99\xbe\xe5\xba\xa6\xe6\x90\x9c\xe7\xb4\xa2" />\n    <link rel="icon" sizes="any" mask href="//www.baidu.com/img/baidu_85beaf5496f291521eb75ba38eacbd87.svg">\n\t\n\t\n\t<link rel="dns-prefetch" href="//s1.bdstatic.com"/>\n\t<link rel="dns-prefetch" href="//t1.baidu.com"/>\n\t<link rel="dns-prefetch" href="//t2.baidu.com"/>\n\t<link rel="dns-prefetch" href="//t3.baidu.com"/>\n\t<link rel="dns-prefetch" href="//t10.baidu.com"/>\n\t<link rel="dns-prefetch" href="//t11.baidu.com"/>\n\t<link rel="dns-prefetch" href="//t12.baidu.com"/>\n\t<link rel="dns-prefetch" href="//b1.bdstatic.com"/>\n    \n    <title>\xe7\x99\xbe\xe5\xba\xa6\xe4\xb8\x80\xe4\xb8\x8b\xef\xbc\x8c\xe4\xbd\xa0\xe5\xb0\xb1\xe7\x9f\xa5\xe9\x81\x93</title>\n    \r\n\r\n<style id="css_index" index="index" type="text/css">html,body{height:100%}\nhtml{overflow-y:auto}\nbody{font:12px arial;text-align:;background:#fff}\nbody,p,form,ul,li{margin:0;padding:0;list-style:none}\nbody,form,#fm{position:relative}\ntd{text-align:left}\nimg{border:0}\na{color:#00c}\na:active{color:#f60}\ninput{border:0;padding:0}\n#wrapper{position:relative;_position:;min-height:100%}\n#head{padding-bottom:100px;text-align:center;*z-index:1}\n#ftCon{height:50px;position:absolute;bottom:47px;text-align:left;width:100%;margin:0 auto;z-index:0;overflow:hidden}\n.ftCon-Wrapper{overflow:hidden;margin:0 auto;text-align:center;*width:640px}\n.qrcodeCon{text-align:center;position:absolute;bottom:140px;height:60px;width:100%}\n#qrcode{display:inline-block;*float:left;*margin-top:4px}\n#qrcode .qrcode-item{float:left}\n#qrcode .qrcode-item-2{margin-left:33px}\n#qrcode .qrcode-img{width:60px;height:60px}\n#qrcode .qrcode-item-1 .qrcode-img{background:url(http://s1.bdstatic.com/r/www/cache/static/home/img/qrcode/zbios_efde696.png) 0 0 no-repeat}\n#qrcode .qrcode-item-2 .qrcode-img{background:url(http://s1.bdstatic.com/r/www/cache/static/home/img/qrcode/nuomi_365eabd.png) 0 0 no-repeat}\n@media only screen and (-webkit-min-device-pixel-ratio:2){#qrcode .qrcode-item-1 .qrcode-img{background-image:url(http://s1.bdstatic.com/r/www/cache/static/home/img/qrcode/zbios_x2_9d645d9.png);background-size:60px 60px}\n#qrcode .qrcode-item-2 .qrcode-img{background-image:url(http://s1.bdstatic.com/r/www/cache/static/home/img/qrcode/nuomi_x2_55dc5b7.png);background-size:60px 60px}}\n#qrcode .qrcode-text{color:#999;line-height:23px;margin:3px 0 0}\n#qrcode .qrcode-text a{color:#999;text-decoration:none}\n#qrcode .qrcode-text p{text-align:center}\n#qrcode .qrcode-text b{color:#666;font-weight:700}\n#qrcode .qrcode-text span{letter-spacing:1px}\n#ftConw{display:inline-block;text-align:left;margin-left:33px;line-height:22px;position:relative;top:-2px;*float:right;*margin-left:0;*position:static}\n#ftConw,#ftConw a{color:#999}\n#ftConw{text-align:center;margin-left:0}\n.bg{background-image:url(http://s1.bdstatic.com/r/www/cache/static/global/img/icons_5859e57.png);background-repeat:no-repeat;_background-image:url(http://s1.bdstatic.com/r/www/cache/static/global/img/icons_d5b04cc.gif)}\n.c-icon{display:inline-block;width:14px;height:14px;vertical-align:text-bottom;font-style:normal;overflow:hidden;background:url(http://s1.bdstatic.com/r/www/cache/static/global/img/icons_5859e57.png) no-repeat 0 0;_background-image:url(http://s1.bdstatic.com/r/www/cache/static/global/img/icons_d5b04cc.gif)}\n.c-icon-triangle-down-blue{background-position:-480px -168px}\n.c-icon-chevron-unfold2{background-position:-504px -168px}\n#m{width:720px;margin:0 auto}\n#nv a,#nv b,.btn,#lk{font-size:14px}\n#nv{height:19px;font-size:16px;margin:0 0 4px;text-align:left;text-indent:137px}\n.s_btn{width:95px;height:32px;padding-top:2px\\9;font-size:14px;background-color:#ddd;background-position:0 -48px;cursor:pointer}\n.s_btn_h{background-position:-240px -48px}\n.s_btn_wr{width:97px;height:34px;display:inline-block;background-position:-120px -48px;*position:relative;z-index:0;vertical-align:top}\n#jgwab{margin-left:19px}\n#cp .c-icon-icrlogo,.c-icon-jgwablogo{width:14px;height:17px;display:inline-block;overflow:hidden;background:url(http://s1.bdstatic.com/r/www/cache/static/global/img/icons_5859e57.png) no-repeat;_background-image:url(http://s1.bdstatic.com/r/www/cache/static/global/img/icons_d5b04cc.gif)}\n#cp .c-icon-icrlogo{background-position:-600px -96px;position:relative;top:3px}\n.c-icon-jgwablogo{background-position:-623px -96px;position:relative;top:3px}\n#shouji{margin-right:14px}\n#u{display:none}\n#c-tips-container{display:none}\n#wrapper{min-width:810px;height:100%;min-height:600px}\n#head{position:relative;padding-bottom:0;height:100%;min-height:600px}\n#head .head_wrapper{height:100%}\n#m{position:relative}\n#fm{padding-left:40px;top:-37px}\n#lh a{margin-left:62px}\n#lh #seth,#lh #setf{margin-left:0}\n#lk{position:absolute;display:none;top:0;right:0;margin:33px 0}\n#lk span{font:14px "\xe5\xae\x8b\xe4\xbd\x93"}\n#nv{position:absolute;display:none;top:0;right:0}\n#lm{color:#666;width:100%;height:60px;margin-top:60px;line-height:15px;font-size:13px;position:absolute;top:0;left:0}\n#lm a{color:#666}\n#pad-version{line-height:40px}\n.s_ipt_wr.bg,.s_btn_wr.bg,#su.bg{background-image:none}\n.s_btn_wr{width:auto;height:auto;border-bottom:1px solid transparent;*border-bottom:0}\n.s_btn{width:100px;height:36px;color:#fff;font-size:15px;letter-spacing:1px;background:#3385ff;border-bottom:1px solid #2d78f4;outline:medium;*border-bottom:0;-webkit-appearance:none;-webkit-border-radius:0}\n.s_btn.btnhover{background:#317ef3;border-bottom:1px solid #2868c8;*border-bottom:0;box-shadow:1px 1px 1px #ccc}\n.s_btn_h{background:#3075dc;box-shadow:inset 1px 1px 5px #2964bb;-webkit-box-shadow:inset 1px 1px 5px #2964bb;-moz-box-shadow:inset 1px 1px 5px #2964bb;-o-box-shadow:inset 1px 1px 5px #2964bb}\n#result_logo{display:none}\n#index_logo img{display:inline-block;width:270px;height:129px}\n#s_tab{display:none}\n.s_form{position:relative;top:38.2%}\n.s_form_wrapper{position:relative;top:-191px}\n.s_ipt_wr{height:34px}\n#head .c-icon-bear-round{display:none}\n#form{margin:22px auto 0;width:641px;text-align:left;z-index:100}\n#form .bdsug,#fm .bdsug{top:35px}\n.bdsug{display:none;position:absolute;width:538px;background:#fff;border:1px solid #ccc;_overflow:hidden;box-shadow:1px 1px 3px #ededed;-webkit-box-shadow:1px 1px 3px #ededed;-moz-box-shadow:1px 1px 3px #ededed;-o-box-shadow:1px 1px 3px #ededed}\n.bdsug.bdsugbg ul{background:url(http://s1.bdstatic.com/r/www/cache/static/home/img/sugbg_1762fe7.png) 100% 100% no-repeat;background-size:100px 110px;background-image:url(http://s1.bdstatic.com/r/www/cache/static/home/img/sugbg_90fc9cf.gif)\\9}\n.bdsug li{width:522px;color:#000;font:14px arial;line-height:25px;padding:0 8px;position:relative;cursor:default}\n.bdsug li.bdsug-s{background:#f0f0f0}\n.bdsug-store span,.bdsug-store b{color:#7A77C8}\n.bdsug-store-del{font-size:12px;color:#666;text-decoration:underline;position:absolute;right:8px;top:0;cursor:pointer;display:none}\n.bdsug-s .bdsug-store-del{display:inline-block}\n.bdsug-ala{display:inline-block;border-bottom:1px solid #e6e6e6}\n.bdsug-ala h3{line-height:14px;background:url(//www.baidu.com/img/sug_bd.png) no-repeat left center;margin:8px 0 5px;font-size:12px;font-weight:400;color:#7B7B7B;padding-left:20px}\n.bdsug-ala p{font-size:14px;font-weight:700;padding-left:20px}\n.bdsug .bdsug-direct{width:auto;padding:0;border-bottom:1px solid #f1f1f1}\n.bdsug .bdsug-direct p{color:#00c;font-weight:700;line-height:34px;padding:0 8px;cursor:pointer;white-space:nowrap;overflow:hidden}\n.bdsug .bdsug-direct p img{width:16px;height:16px;margin:7px 6px 9px 0;vertical-align:middle}\n.bdsug .bdsug-direct p span{margin-left:8px}\n.bdsug .bdsug-direct p i{font-size:12px;line-height:100%;font-style:normal;font-weight:400;color:#fff;background-color:#2b99ff;display:inline;text-align:center;padding:1px 5px;*padding:2px 5px 0;margin-left:8px;overflow:hidden}\n.bdsug .bdsug-pcDirect{color:#000;font-size:14px;line-height:30px;height:30px;background-color:#f8f8f8}\n.bdsug .bdsug-pc-direct-tip{position:absolute;right:15px;top:8px;width:55px;height:15px;display:block;background:url(http://s1.bdstatic.com/r/www/cache/static/global/img/pc_direct_42d6311.png) no-repeat 0 0}\n.bdsug li.bdsug-pcDirect-s{background-color:#f0f0f0}\n.bdsug .bdsug-pcDirect-is{color:#000;font-size:14px;line-height:22px;background-color:#f8f8f8}\n.bdsug .bdsug-pc-direct-tip-is{position:absolute;right:15px;top:3px;width:55px;height:15px;display:block;background:url(http://s1.bdstatic.com/r/www/cache/static/global/img/pc_direct_42d6311.png) no-repeat 0 0}\n.bdsug li.bdsug-pcDirect-is-s{background-color:#f0f0f0}\n.bdsug .bdsug-pcDirect-s .bdsug-pc-direct-tip,.bdsug .bdsug-pcDirect-is-s .bdsug-pc-direct-tip-is{background-position:0 -15px}\n.bdsug .bdsug-newicon{color:#929292;opacity:.7;font-size:12px;display:inline-block;line-height:22px;letter-spacing:2px}\n.bdsug .bdsug-s .bdsug-newicon{opacity:1}\n.bdsug .bdsug-newicon i{letter-spacing:0;font-style:normal}\n.toggle-underline{text-decoration:none}\n.toggle-underline:hover{text-decoration:underline}\n.tools{position:absolute;right:-75px}\n#mHolder{width:62px;position:relative;z-index:296;display:none}\n#mCon{height:18px;line-height:18px;position:absolute;cursor:pointer}\n#mCon span{color:#00c;display:block;width:24px}\n#mCon .hw{text-decoration:underline;cursor:pointer;display:inline-block}\n#mCon .pinyin{display:inline-block}\n#mCon .c-icon-chevron-unfold2{margin-left:5px}\n#mMenu a{width:100%;height:100%;display:block;line-height:22px;text-indent:6px;text-decoration:none;filter:none\\9}\n#mMenu,#user ul{box-shadow:1px 1px 2px #ccc;-moz-box-shadow:1px 1px 2px #ccc;-webkit-box-shadow:1px 1px 2px #ccc;filter:progid:DXImageTransform.Microsoft.Shadow(Strength=2, Direction=135, Color=#cccccc)\\9}\n#mMenu{width:56px;border:1px solid #9b9b9b;list-style:none;position:absolute;right:27px;top:28px;display:none;background:#fff}\n#mMenu a:hover{background:#ebebeb}\n#mMenu .ln{height:1px;background:#ebebeb;overflow:hidden;font-size:1px;line-height:1px;margin-top:-1px}\n#u1 a:link,#u1 a:visited{color:#666;text-decoration:none}\n#u1 a:hover,#u1 a:active{text-decoration:underline}\n#u1 a:active{color:#00c}\n#u1{z-index:2;color:#fff;position:absolute;right:0;top:0;margin:19px 0 5px;padding:0 96px 0 0}\n#u1 .reg{display:none}\n#u1 a.pf,#u1 a.pf:visited{display:inline-block;float:left;color:#333;line-height:24px;font-size:13px;margin-left:20px;overflow:hidden;text-decoration:underline}\n#u1 a.lb,#u1 a.lb:visited,#u1 a.username{display:inline-block;float:left;color:#333;font-size:13px;line-height:24px;margin-left:20px;text-decoration:underline}\n#u1 a.bri,#u1 a.bri:visited{display:inline-block;position:absolute;right:10px;width:60px;height:23px;float:left;color:#fff;background:#38f;line-height:24px;font-size:13px;text-align:center;overflow:hidden;border-bottom:1px solid #38f;margin-left:19px;margin-right:2px}\n#u1 a.bri.brihover{display:none;text-decoration:none;color:#333;background:0 0;border-bottom:1px solid transparent;margin-left:19px}\n#u1 #lm a{color:#00c;text-decoration:underline}\n#u1 a.mnav,#u1 a.mnav:visited{float:left;color:#333;font-weight:700;line-height:24px;margin-left:20px;font-size:13px;text-decoration:underline}\n#u1 a.pf:hover,#u1 a.lb:hover,#u1 a.mnav:hover{color:#00c}\n.briiconsbg{background-repeat:no-repeat;background-size:300px 18px;background-image:url(http://s1.bdstatic.com/r/www/cache/static/home/img/icons_0c37e9b.png);background-image:url(http://s1.bdstatic.com/r/www/cache/static/home/img/icons_809ae65.gif)\\9}\n.bdpfmenu{background-color:#fff;border:1px solid #d1d1d1;position:absolute;right:160px;width:68px;top:36px;margin-top:-1px;_margin-top:-3px;z-index:2;box-shadow:1px 1px 5px #d1d1d1;-webkit-box-shadow:1px 1px 5px #d1d1d1;-moz-box-shadow:1px 1px 5px #d1d1d1;-o-box-shadow:1px 1px 5px #d1d1d1}\n.bdpfmenu a{display:block;text-align:left;margin:0!important;padding:0 9px;line-height:26px;text-decoration:none}\n#wrapper .bdpfmenu a:link,#wrapper .bdpfmenu a:visited{background:#fff;color:#333}\n#wrapper .bdpfmenu a:hover,#wrapper .bdpfmenu a:active{background:#38f;text-decoration:none;color:#fff}\n#wrapper .bdnuarrow{width:0;height:0;font-size:0;line-height:0;display:block;position:absolute;top:-10px;left:50%;margin-left:-5px}\n#wrapper .bdnuarrow em,#wrapper .bdnuarrow i{width:0;height:0;font-size:0;line-height:0;display:block;position:absolute;border:5px solid transparent;border-style:dashed dashed solid}\n#wrapper .bdnuarrow em{border-bottom-color:#d8d8d8;top:-1px}\n#wrapper .bdnuarrow i{border-bottom-color:#fff;top:0}\n.s-isindex-wrap #wrapper .bdnuarrow{height:13px;background:url(http://s1.bdstatic.com/r/www/cache/static/home/img/icons_0c37e9b.png) no-repeat -90px -1px}\n#wrapper .bdnuarrow.bdbriarrow{right:104px;display:none!important}\n#wrapper .bdbri{width:85px;min-height:100px;border-left:1px solid #e7e7e7;position:absolute;background-color:#f9f9f9;overflow:hidden;z-index:2;right:0;top:0}\n#prefpanel{background:#fafafa;display:none;opacity:0;position:fixed;_position:absolute;top:-359px;z-index:1000;width:100%;min-width:960px;border-bottom:1px solid #ebebeb}\n#prefpanel form{_width:850px}\n#wrapper .bdbriimgtitle{color:#333;text-align:center;width:66px;height:43px;line-height:43px;padding-top:9px;margin:0 auto;border-bottom:#f0f0f0 1px solid;font-size:13px;cursor:default}\n#wrapper .briscrollwrapper{overflow:hidden}\n#wrapper .briscrollwrapperContainer{position:relative}\n#wrapper .bdbri.bdbriimg .bdmainlink a,#wrapper .bdbri.bdbriimg .bdothlink a{display:block;text-align:center;width:66px;height:76px;margin:0 auto;border-bottom:#f0f0f0 1px solid;color:#666;text-decoration:none;overflow:hidden}\n#wrapper .bdbri.bdbriimg .bdmainlink a:visited,#wrapper .bdbri.bdbriimg .bdothlink a:visited{color:#666}\n#wrapper .bdbri.bdbriimg .bdmainlink a:hover,#wrapper .bdbri.bdbriimg .bdothlink a:hover{color:#666;text-decoration:underline}\n#wrapper .bdbri.bdbriimg .bdmainlink a:active,#wrapper .bdbri.bdbriimg .bdothlink a:active{color:#00c;text-decoration:underline}\n#wrapper .bdbri.bdbriimg span{width:36px;height:36px;display:block;margin:10px auto 5px;background:url(http://s1.bdstatic.com/r/www/cache/static/home/img/logos/bdbri_icons_0a62ce1.png) no-repeat;cursor:pointer}\n#wrapper .bdbri.bdbriimg .bdbrimore,#wrapper .bdbri.bdbriimg .bdbrievenmore{clear:both;text-align:center}\n#wrapper .bdbri.bdbriimg .bdbrievenmore{margin-top:15px;height:30px;width:85px;overflow:hidden}\n#wrapper .bdbri.bdbriimg span.bdbriimgitem_1{background-position:0 0}\n#wrapper .bdbri.bdbriimg span.bdbriimgitem_2{background-position:-36px 0}\n#wrapper .bdbri.bdbriimg span.bdbriimgitem_3{width:40px;background-position:-72px 0}\n#wrapper .bdbri.bdbriimg span.bdbriimgitem_4{background-position:-112px 0}\n#wrapper .bdbri.bdbriimg span.bdbriimgitem_5{background-position:-148px 0}\n#wrapper .bdbri.bdbriimg span.bdbriimgitem_6{background-position:-184px 0}\n#wrapper .bdbri.bdbriimg span.bdbriimgitem_7{background-position:-220px 0}\n#wrapper .bdbri.bdbriimg .bdbrievenmore a:link,#wrapper .bdbri.bdbriimg .bdbrievenmore a:visited{color:#666;text-decoration:underline}\n#wrapper .bdbri.bdbriimg .bdbrievenmore a:hover{color:#666;text-decoration:underline}\n#wrapper .bdbri.bdbriimg .bdbrievenmore a:active{color:#00c}\n.bdbriscroll-ctrl-scroll{position:absolute;top:10px;right:1px;width:8px;border-top:1px solid #e4e4e4;border-left:1px solid #e4e4e4;cursor:default;-webkit-user-select:none;-moz-user-select:none}\n.bdbriscroll-ctrl-scroll .bdbriscroll-axis{width:8px;left:0;z-index:0;position:absolute;background:#f2f2f2}\n.bdbriscroll-ctrl-scroll-touch .bdbriscroll-axis{width:7px;background:#f2f2f2}\n.bdbriscroll-ctrl-scroll-hover .bdbriscroll-axis{background:#f2f2f2}\n.bdbriscroll-ctrl-scroll .bdbriscroll-slider{overflow:hidden;width:7px;height:14px;position:absolute;left:0;z-index:10;display:none;background:#d9d9d9;margin-top:-1px;margin-left:-1px;border-right:1px solid #cecece;border-bottom:1px solid #cecece;cursor:default}\n.bdbriscroll-ctrl-scroll-touch .bdbriscroll-slider,.bdbriscroll-ctrl-scroll-hover .bdbriscroll-slider{background:#b8b8b8;border-right:1px solid #afafaf;border-bottom:1px solid #afafaf}\n.s_ipt::-webkit-input-placeholder{padding-left:3px;color:#aaa;font-size:13px}\n.s_ipt::-moz-placeholder{padding-left:3px;color:#aaa;font-size:13px}\n.s_ipt:-ms-input-placeholder{padding-left:3px;color:#aaa;font-size:13px}\n.s_ipt::placeholder{padding-left:3px;color:#aaa;font-size:13px}\n.kw-placeholder{position:absolute;top:0;left:0;color:#aaa;font-size:13px;height:35px;line-height:35px;padding-left:10px;max-width:360px;z-index:99;pointer-events:none}\n.kw-placeholder.placeholders-hidden{visibility:hidden}</style>\r\n\r\n<!--[if lte IE 8]>\r\n<style index="index" data-compress="strip">\r\n.s_form{top:260px}\r\n</style>\r\n<![endif]-->\r\n<!--[if IE 8]>\r\n<style index="index" data-compress="strip">\r\n#u1 a.mnav,#u1 a.mnav:visited,#u1 a.lb,#u1 a.lb:visited,#u1 a.pf,#u1 a.pf:visited,#u1 a.bri,#u1 a.bri:visited{font-family:simsun;}\r\n</style>\r\n<![endif]-->\r\n<style data-for="debug">\r\n#debug{display:none!important;}\r\n</style>\r\n<style data-for="result" id="css_index_result" type="text/css">#seth{display:inline;behavior:url(#default#homepage)}\n#setf{display:inline}\n#sekj{margin-left:14px}\n#st,#sekj{display:none}\n.s_ipt_wr{border:1px solid #b6b6b6;border-color:#7b7b7b #b6b6b6 #b6b6b6 #7b7b7b;background:#fff;display:inline-block;vertical-align:top;width:539px;margin-right:0;border-right-width:0;border-color:#b8b8b8 transparent #ccc #b8b8b8;overflow:hidden}\n.wrapper_s .s_ipt_wr{width:439px}\n.wrapper_s .s_ipt{width:434px}\n.wrapper_s .s_ipt_tip{width:434px}\n.s_ipt_wr:hover,.s_ipt_wr.ipthover{border-color:#999 transparent #b3b3b3 #999}\n.s_ipt_wr.iptfocus{border-color:#4791ff transparent #4791ff #4791ff}\n.s_ipt_tip{color:#aaa;position:absolute;z-index:-10;font:16px/22px arial;height:32px;line-height:32px;padding-left:7px;overflow:hidden;width:526px}\n.s_ipt{width:526px;height:22px;font:16px/18px arial;line-height:22px;margin:6px 0 0 7px;padding:0;background:transparent;border:0;outline:0;-webkit-appearance:none}\n#kw{position:relative}\n#u .username i{background-position:-408px -144px}\n.bdpfmenu,.usermenu{border:1px solid #d1d1d1;position:absolute;width:105px;top:36px;z-index:302;box-shadow:1px 1px 5px #d1d1d1;-webkit-box-shadow:1px 1px 5px #d1d1d1;-moz-box-shadow:1px 1px 5px #d1d1d1;-o-box-shadow:1px 1px 5px #d1d1d1}\n.bdpfmenu{font-size:12px;background-color:#fff}\n.bdpfmenu a,.usermenu a{display:block;text-align:left;margin:0!important;padding:0 9px;line-height:26px;text-decoration:none}\n.briiconsbg{background-repeat:no-repeat;background-size:300px 18px;background-image:url(http://s1.bdstatic.com/r/www/cache/static/home/img/icons_0c37e9b.png);background-image:url(http://s1.bdstatic.com/r/www/cache/static/home/img/icons_809ae65.gif)\\9}\n#u{z-index:301;position:absolute;right:0;top:0;margin:21px 9px 5px 0;padding:0}\n.wrapper_s #u{margin-right:3px}\n#u a{text-decoration:underline;color:#333;margin:0 7px}\n.wrapper_s #u a{margin-right:0 6px}\n#u div a{text-decoration:none}\n#u a:hover{text-decoration:underline}\n#u .back_org{color:#666;float:left;display:inline-block;height:24px;line-height:24px}\n#u .bri{display:inline-block;width:24px;height:24px;float:left;line-height:24px;color:transparent;background:url(http://s1.bdstatic.com/r/www/cache/static/home/img/icons_0c37e9b.png) no-repeat 4px 3px;background-size:300px 18px;background-image:url(http://s1.bdstatic.com/r/www/cache/static/home/img/icons_809ae65.gif)\\9;overflow:hidden}\n#u .bri:hover,#u .bri.brihover{background-position:-18px 3px}\n#mCon #imeSIcon{background-position:-408px -144px;margin-left:0}\n#mCon span{color:#333}\n.bdpfmenu a:link,.bdpfmenu a:visited,#u .usermenu a:link,#u .usermenu a:visited{background:#fff;color:#333}\n.bdpfmenu a:hover,.bdpfmenu a:active,#u .usermenu a:hover,#u .usermenu a:active{background:#38f;text-decoration:none;color:#fff}\n.bdpfmenu{width:70px}\n.usermenu{width:68px;right:8px}\n#wrapper .bdnuarrow{width:0;height:0;font-size:0;line-height:0;display:block;position:absolute;top:-10px;left:50%;margin-left:-5px}\n#wrapper .bdnuarrow em,#wrapper .bdnuarrow i{width:0;height:0;font-size:0;line-height:0;display:block;position:absolute;border:5px solid transparent;border-style:dashed dashed solid}\n#wrapper .bdnuarrow em{border-bottom-color:#d8d8d8;top:-1px}\n#wrapper .bdnuarrow i{border-bottom-color:#fff;top:0}\n#prefpanel{background:#fafafa;display:none;opacity:0;position:fixed;_position:absolute;top:-359px;z-index:500;width:100%;min-width:960px;border-bottom:1px solid #ebebeb}\n#prefpanel form{_width:850px}\n#kw_tip{cursor:default;display:none;margin-top:1px}\n#bds-message-wrapper{top:43px}\n.quickdelete-wrap{position:relative}\n.quickdelete-wrap input{width:500px}\n.wrapper_l .quickdelete-wrap input{width:500px}\n.wrapper_s .quickdelete-wrap input{width:402px}\ninput::-ms-clear{display:none}\n.quickdelete{width:32px;height:32px;background:url(http://s1.bdstatic.com/r/www/cache/static/global/img/quickdelete_33e3eb8.png) no-repeat;background-position:10px 10px;position:absolute;display:block}\n.quickdelete:hover{background-position:10px -24px}\n#lh a{margin-left:25px}\n.bdbriwrapper-tuiguang{display:none!important}</style>\r\n<!--[if IE 8]>\r\n<style index="index" data-compress="strip">\r\n.s_ipt{background-color:#FFF;}\r\n</style>\r\n<![endif]-->\r\n\n    \r\n<script data-compress="strip">\r\nfunction h(obj){\r\n    obj.style.behavior=\'url(#default#homepage)\';\r\n\tvar a = obj.setHomePage(\'//www.baidu.com/\');\r\n}\r\n</script>\r\n\r\n<noscript>\r\n    <meta http-equiv="refresh" content="0; url=/baidu.html?from=noscript"/>\r\n</noscript>\r\n\n    <script>window._ASYNC_START=new Date().getTime();</script>\n</head>\n\n<body link="#0000cc">\n\t<script>\n\tif (/Chrome\\/37.0.2062.94/i.test(navigator.userAgent) && (/(windows 7)|(windows nt 6.1)/i.test(navigator.userAgent))) {\n\t\tvar _chrome_37_fix = document.createElement("style");\n\t\t_chrome_37_fix.type="text/css";\n\t\t_chrome_37_fix.setAttribute("data-for","result");\n\t\t_chrome_37_fix.innerHTML = ".t,.f16,#kw,.s_ipt,.c-title,.c-title-size,.to_zhidao,.to_tieba,.to_zhidao_bottom{font-size:15px;} .ec-hospital-info-main h2,.ad-widget-gx_sck-ylzx-doctor-info h2,.ec-card-main h2,.ad-widget-h1 h2,.ad-widget-title h2,.ad-widget-small-head h2,.ad-widget-small-head h2 a,.ad-widget-header .ec-figcaption h2{font-size: 15px !important;}";\n\t\tdocument.ge
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值