Python怎么爬虫博文

本篇内容主要讲解“Python怎么爬虫博文”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“Python怎么爬虫博文”吧!

创新互联建站专注为客户提供全方位的互联网综合服务,包含不限于网站建设、成都网站建设、千阳网络推广、小程序定制开发、千阳网络营销、千阳企业策划、千阳品牌公关、搜索引擎seo、人物专访、企业宣传片、企业代运营等,从售前售中售后,我们都将竭诚为您服务,您的肯定,是我们最大的嘉奖;创新互联建站为所有大学生创业者提供千阳建站搭建服务,24小时服务热线:18982081108,官方网址:www.cdcxhl.com

一. 大数据及数据挖掘基础

***部分主要简单介绍三个问题:

1、什么是大数据?

2、什么是数据挖掘?

3、大数据和数据挖掘的区别?

1、大数据(Big Data)

大数据(big data)指无法在一定时间范围内用常规软件工具进行捕捉、管理和处理的数据集合,是需要新处理模式才能具有更强的决策力、洞察发现力和流程优化能力来适应海量、高增长率和多样化的信息资产。

下图是大数据经典的4V特征。

Python怎么爬虫博文

IBM大数据库框架及可视化技术,大数据常用:Hadoop、Spark,现在更多的是实时数据分析,包括淘宝、京东、附近美食等。

Python怎么爬虫博文

下图是大数据的一些应用

Python怎么爬虫博文

Python怎么爬虫博文

说到大数据,就不得不提Hadoop,而说到Hadoop,又不得不提Map-Reduce。

Python怎么爬虫博文

MapReduce是一个软件框架由上千个商用机器组成的大集群上,并以一种可靠的,具有容错能力的方式并行地处理上TB级别的海量数据集。MapReduce的思想是“分而治之”。Mapper负责“分,Reducer负责对map阶段的结果进行汇总。

2、数据挖掘(Data Mining)

数据挖掘(Data Mining):数据库、机器学习、人工智能、统计学的交叉学科。

数据挖掘需要发现有价值的知识,同时最顶端都是具有智慧的去发现知识及有价值的信息。

Python怎么爬虫博文

Python怎么爬虫博文

因为它主要是针对网页数据进行的大数据分析,需要Web Mining分类如下:

Python怎么爬虫博文

Web挖掘主要分为三类:Web日志挖掘、Web内容挖掘、Web结构挖掘。

Python怎么爬虫博文

3、机器学习

讲到机器学习和数据挖掘相关的知识,通常都会补充两幅图片。很形象的表示了计算机智能化与人类传统知识的类比。

Python怎么爬虫博文

Python怎么爬虫博文

二. 安装Python及基础知识

1、安装Python

在开始使用Python编程之前,需要介绍Python的安装过程。python解释器在Linux中可以内置使用安装

步骤如下:

***步:打开Web浏览器并访问官网;

Python怎么爬虫博文

第二步:

在官网首页点击Download链接,进入下载界面,选择Python软件的版本,作者选择下载python 2.7.8,点击“Download”链接。

Python下载地址:

第三步:选择文件下载地址,并下载文件。

第四步:双击下载的“python-2.7.8.msi”软件,并对软件进行安装。

Python怎么爬虫博文

第五步:在Python安装向导中选择默认设置,点击“Next”,选择安装路径,这里设置为默认的安装路径“C:Python27”,点击“Next”按钮,如图所示。

注意1:建议将Python安装在C盘下,通常路径为C:Python27,不要存在中文路径。

Python怎么爬虫博文

在Python安装向导中选择默认设置,点击“Next”,选择安装路径,这里设置为默认的安装路径“C:Python27”,点击“Next”按钮。

Python怎么爬虫博文

安装成功后,如下图所示:

Python怎么爬虫博文

第六步:假设安装一切正常,点击“开始”,选中“程序”,找到安装成功的Python软件,如图所示:

Python怎么爬虫博文

选中上图中第三个图标,即点击“Python (command line)命令行模式”,运行程序输入如下代码:

print 'hello world'

则python命令行模式的解释器会打印输出“hello world”字符串,如下图所示。

Python怎么爬虫博文

选中图中的***个图片,点击“IDLE (Python GUI)”,即运行Python的集成开发环境(Python Integrated Development Environment,IDLE),运行结果如下图。

注意2:建议大家使用IDLE写脚本,完整的代码而不是通过命令行模式。

Python怎么爬虫博文

2、Python基础知识

这里简单入门介绍,主要介绍下条件语句、循环语句、函数等基础知识。

a、函数及运行

这里举个简单的例子。打开IDLE工具->点击栏"File"->New File新建文件->命名为test.py文件,在test文件里添加代码如下:

Python怎么爬虫博文

保存文件。并在test.py文件里点击Run->Run Module,输出结果如下图所示。

Python怎么爬虫博文

b、条件语句

包括单分支、双分支和多分支语句,if-elif-else。

(1).单分支语句

它的基本格式是:

if condition:  statement  statement

需要注意的是Ptthon中if条件语句条件无需圆括号(),条件后面需要添加冒号,它没有花括号{}而是使用TAB实现区分。其中condition条件判断通常有布尔表达式(True|False 0-假|1-真 非0即真)、关系表达式(>= <= == !=)和逻辑运算表达式(and or not)。

(2).双分支语句

它的基本格式是:

if condition:  statement  statement  else:  statement  statement

(3).多分支语句

if多分支由if-elif-else组成,其中elif相当于else if,同时它可以使用多个if的嵌套。具体代码如下所示:

Python怎么爬虫博文

c、while循环语句

while循环语句的基本格式如下:

while condition:  statement  statement  else:  statement  statement

其中判断条件语句condition可以为布尔表达式、关系表达式和逻辑表达式,else可以省略(此处列出为与C语言等区别)。举个例子:

Python怎么爬虫博文

d、for循环

该循环语句的基础格式为:

for target in sequences:  statements

target表示变量名,sequences表示序列,常见类型有list(列表)、tuple(元组)、strings(字符串)和files(文件)。

Python的for没有体现出循环的次数,不像C语言的for(i=0;i<10;i++)中i循环计数,Python的for指每次从序列sequences里面的数据项取值放到target里,取完即结束,取多少次循环多少次。其中in为成员资格运算符,检查一个值是否在序列中。同样可以使用break和continue跳出循环。

下面是文件循环遍历的过程:

Python怎么爬虫博文

e、课堂讲解代码

仅供大家参考:

Python怎么爬虫博文

输出结果如下图所示:

Python怎么爬虫博文

三. 安装PIP及第三方包

接下来需要详解介绍爬虫相关的知识了,这里主要涉及到下面几个知识:

Python怎么爬虫博文

爬虫主要使用Python(字符串|urllib)+Selenium+PhantomJS+BeautifulSoup。

Python怎么爬虫博文

在介绍爬虫及Urllib下载网页或图片之前,先教大家如何使用pip安装第三方的库。

PIP

在介绍介绍它们之前,需要安装PIP软件。“作为Python爱好者,如果不知道easy_install或者pip中的任何一个的话,那么......”。

easy_insall的作用和perl中的cpan,ruby中的gem类似,都提供了在线一键安装模块的傻瓜方便方式,而pip是easy_install的改进版,提供更好的提示信息,删除package等功能。老版本的python中只有easy_install,没有pip。常见的具体用法如下:

Python怎么爬虫博文

***步:下载PIP软件

可以在官网http://pypi.python.org/pypi/pip#downloads下载,同时cd切换到PIP目录,在通过python setup.py install安装。而我采用的是下载pip-Win_1.7.exe进行安装

第二步:安装PIP软件

Python怎么爬虫博文

Python怎么爬虫博文

当提示"pip and virtualenv installed"表示安装成功,那怎么测试PIP安装成功呢?

第三步:配置环境变量

此时在cmd中输入pip指令会提示错误“不是内部或外部命令”。

Python怎么爬虫博文

注意:两种解决方法,一种是通过cd ..去到Srcipts环境进行安装,pip install...

Python怎么爬虫博文

方法二:另一种配置Path路径。

需要添加path环境变量。PIP安装完成后,会在Python安装目录下添加pythonScripts目录,即在python安装目录的Scripts目录下,将此目录加入环境变量中即可!过程如下:

Python怎么爬虫博文

Python怎么爬虫博文

第四步:使用PIP命令

下面在CMD中使用PIP命令,“pip list outdate”列举Python安装库的版本信息。

Python怎么爬虫博文

注意:安装成功后,会在Python环境中增加Scripts文件夹,包括easy_install和pip。

Python怎么爬虫博文

PIP安装过程中可能出现各种问题,一种解决方法是去到python路径,通过python set_up.py install安装;另一种是配置Path环境比例。

课堂重点知识:

***节课主要想让大家体会下Python网络爬虫的过程及示例。需要安装的第三方库主要包括三个:

pip install httplib2  pip install urllib  pip install selenium

Python怎么爬虫博文

在安装过程中,如果pip install urllib报错,是因为httplib2包含了,可直接用。

Python怎么爬虫博文

注意:如果pip安装报错ascii编码问题,需要把计算机名称从中文修改为英文名。

四. Urllib下载网页及图片

在使用pip install urllib或pip install urllib2后,下面这段代码是下载网页。

Python怎么爬虫博文

首先我们调用的是urllib2库里面的urlopen方法,传入一个URL,这个网址是百度首页,协议是HTTP协议,当然你也可以把HTTP换做FTP、FILE、HTTPS 等等,只是代表了一种访问控制协议,urlopen一般接受三个参数,它的参数如下:

Python怎么爬虫博文

***个参数url即为URL,第二个参数data是访问URL时要传送的数据,第三个timeout是设置超时时间。

第二三个参数是可以不传送的,data默认为空None,timeout默认为 socket._GLOBAL_DEFAULT_TIMEOUT。

***个参数URL是必须要传送的,在这个例子里面我们传送了百度的URL,执行urlopen方法之后,返回一个response对象,返回信息便保存在这里面。

Python怎么爬虫博文

response对象有一个read方法,可以返回获取到的网页内容。

获取的网页本地保存为"baidu.html",通过浏览器打开如下图所示:

Python怎么爬虫博文

然后是需要下载图片,这里需要学会找到图片的URL,如下图百度的LOGO,可以通过浏览器右键"审查元素"或"检查"来进行定位。

Python怎么爬虫博文

定位URL后,再通过函数urlretrieve()进行下载。

Python怎么爬虫博文

重点知识:

urllib.urlopen(url[, data[, proxies]]) :创建一个表示远程url的类文件对象,然后像本地文件一样操作这个类文件对象来获取远程数据。

urlretrieve方法直接将远程数据下载到本地。

如果需要显示进度条,则使用下面这段代码:

Python怎么爬虫博文

五. HTML网页基础知识及审查元素

HTML DOM是HTML Document Object Model(文档对象模型)的缩写,HTML DOM则是专门适用于HTML/XHTML的文档对象模型。熟悉软件开发的人员可以将HTML DOM理解为网页的API。它将网页中的各个元素都看作一个个对象,从而使网页中的元素也可以被计算机语言获取或者编辑。

Python怎么爬虫博文

DOM是以层次结构组织的节点或信息片断的集合。这个层次结构允许开发人员在树中导航寻找特定信息。分析该结构通常需要加载整个文档和构造层次结构,然后才能做任何工作。由于它是基于信息层次的,因而 DOM 被认为是基于树或基于对象的。

Python怎么爬虫博文

HTML DOM 定义了访问和操作HTML文档的标准方法。 HTML DOM 把 HTML 文档呈现为带有元素、属性和文本的树结构(节点树)。它们都是一个节点(Node),就像公司的组织结构图一样。 我们现在从另一个角度来审视源代码,first.html的源码如下:

Python怎么爬虫博文

这个例子的***个元素就是元素,在这个元素的起始标签和终止标签之间,又有几个标签分别起始和闭合,包括、和<body>。<head>和<body>标签是直接被<html>元素包含的,而<title>标签则包含在<head>标签内。要描述一个HTML网页的这种多层结构,用树来进行类比是***的方式。树形结构如下图所示:</p><p><img src="/upload/otherpic51/434669.jpg" alt="Python怎么爬虫博文"></p><p>重点:</p><p>在网络爬虫中,通常需要结合浏览器来定位元素,浏览器右键通常包括两个重要的功能:查看源代码和审查或检查元素。</p><p><img src="/upload/otherpic51/434672.jpg" alt="Python怎么爬虫博文"></p><p>通过审查元素,可以定位到需要爬取图片或网页的HTML源文件,通常是table或div的布局,这些HTML标签通常是成对出现的,如<html></html>、<div></div>等;同时会包括一些属性id、name、class来指定该标签。如:</p><pre><div id="content" name="n1" class="cc">....</div></pre><p><img src="/upload/otherpic51/434673.jpg" alt="Python怎么爬虫博文"></p><p><strong>六. 安装Selenium及网页简单爬取</strong></p><p>Selenium用于Web应用程序测试的工具,模拟浏览器用户操作,通过Locating Elements 定位元素。安装过程如下图所示,通过pip install selenium安装。</p><p>注意:需要cd去到Scripts目录进行安装。</p><p><img src="/upload/otherpic51/434675.jpg" alt="Python怎么爬虫博文"></p><p><img src="/upload/otherpic51/434676.jpg" alt="Python怎么爬虫博文"></p><p>selenium结合浏览器定位的基本函数包括:</p><p><img src="/upload/otherpic51/434677.jpg" alt="Python怎么爬虫博文"></p><p>***个基于Selenium爬虫的代码,通过调用Firefox浏览器:</p><p><img src="/upload/otherpic51/434678.jpg" alt="Python怎么爬虫博文"></p><p>输出如下图所示:</p><p><img src="/upload/otherpic51/434679.jpg" alt="Python怎么爬虫博文"></p><p>到此,相信大家对“Python怎么爬虫博文”有了更深的了解,不妨来实际操作一番吧!这里是创新互联网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!</p> <br> 当前文章:Python怎么爬虫博文 <br> 当前网址:<a href="http://hzjierui.cn/article/gciehc.html">http://hzjierui.cn/article/gciehc.html</a> </div> </div> <div class="other"> <h3>其他资讯</h3> <ul> <li> <a href="/article/doesdds.html">怎么查mysql在哪里 怎么看mysql</a> </li><li> <a href="/article/doesddp.html">关于python函数实现卷积的信息</a> </li><li> <a href="/article/doesdoj.html">vb.net画圆角矩形 vb圆角矩形怎么设置</a> </li><li> <a href="/article/doesohg.html">Dynamics杂志缩写 杂志缩写查询</a> </li><li> <a href="/article/doesdcd.html">zblog后台更新 zblog用户中心插件</a> </li> </ul> </div> </div> <div class="f_service_con"> <div class="h_fumin"> <div class="h_fumin_lei"> <div class="h_fumin_lei_tu"><img src="/Public/Home/images/f_service01.png"></div> <p>售后响应及时</p><span>7×24小时客服热线</span> </div> <div class="h_fumin_lei"> <div class="h_fumin_lei_tu"><img src="/Public/Home/images/f_service02.png"></div> <p>数据备份</p><span>更安全、更高效、更稳定</span> </div> <div class="h_fumin_lei"> <div class="h_fumin_lei_tu"><img src="/Public/Home/images/f_service03.png"></div> <p>价格公道精准</p><span>项目经理精准报价不弄虚作假</span> </div> <div class="h_fumin_lei"> <div class="h_fumin_lei_tu"><img src="/Public/Home/images/f_service04.png"></div> <p>合作无风险</p><span>重合同讲信誉,无效全额退款</span> </div> </div> </div> <div class="footerbar"> <div class="footer-t"> <div class="f-box"> <div class="f-1"> <div class="f-t"> <h2>联系我们</h2> <span>TEL</span> </div> <div class="f-b"> <h1><a href="tel:13518219792" rel="nofollow">135-1821-9792</a></h1> <h1><a href="tel:028-86922220" rel="nofollow">028-86922220</a></h1> <p>地址:成都市太升南路288号锦天国际</p> </div> </div> <div class="f-2"> <div class="f-t"> <h2>快捷导航</h2> <span>Shortcut</span> </div> <div class="f-b"> <ul > </ul> <ul > <li><a href="/jianshe" title="彭州网站建设">彭州网站建设</a></li> <li><a href="/jianshe#ym_websiteBox2" title="品牌网站建设">品牌网站建设</a></li> <li><a href="/jianshe#ym_websiteBox1" title="企业网站建设">企业网站建设</a></li> <li><a href="/jianshe#ym_websiteBox4" title="集团网站建设">集团网站建设</a></li> <li><a href="/jianshe#ym_websiteBox4_2" title="外贸网站建设">外贸网站建设</a></li> <li><a href="/jianshe#ym_websiteBox4_5" title="企业宣传视频">企业宣传视频</a></li> </ul> <ul > <li><a href="/weixin" title="微信开发">微信开发</a></li> <li><a href="/weixin#item1" title="公众号开发">公众号开发</a></li> <li><a href="/weixin#item2" title="微商城建设">微商城建设</a></li> <li><a href="/weixin#item3" title="微官网建设">微官网建设</a></li> <li><a href="/weixin#item4" title="小程序开发">小程序开发</a></li> </ul> <ul> <li><a href="/case/" title="网站作品案例">网站作品案例</a></li> <li><a href="/case/" title="品牌网站案例">品牌网站案例</a></li> <li><a href="/case/" title="集团网站案例">集团网站案例</a></li> <li><a href="/case/" title="企业网站案例">企业网站案例</a></li> <li><a href="/case/" title="外贸网站案例">外贸网站案例</a></li> <li><a href="/case/" title="营销网站案例">营销网站案例</a></li> </ul> <ul style="margin:0;"> <li><a href="/about/">广皓图文建站</a></li> <li><a href="/about/">公司简介</a></li> <li><a href="/about#ab_item3">企业文化</a></li> <li><a href="/contact">联系我们</a></li> <li><a href="/Pay.html">付款方式</a></li> <li><a href="/jianshe#ym_websiteBox8">售后服务</a></li> </ul> <div style="clear:both;"></div> </div> </div> <div class="f-3"> <div class="f-t"> <h2>二维码</h2> <span>QR CODE</span> </div> <div class="f-b"> <ul> <li><img src="/Public/Home/images/fewm.png"> <p>微信公众号</p> </li> <li style="margin: 0"><img src="/Public/Home/images/fewm2.png"> <p>手机端网站</p> </li> <div style="clear:both;"></div> </ul> </div> </div> <div style="clear:both;"></div> </div> </div> <div class="footer-about"> <div class="w1200">彭州广皓图文建站工作室是一家专注从事于高品质视觉体验及互联网设计开发,<a href="/" target="_blank">彭州网站建设</a>,<a href="/jianshe" target="_blank">彭州网站设计</a>,<a href="/jianshe" target="_blank">彭州网页设计</a>,<a href="/jianshe" target="_blank">彭州网站制作</a>,<a href="/jianshe#ym_websiteBox2" target="_blank">品牌网站建设</a>,<a href="/jianshe#ym_websiteBox3" target="_blank">营销网站建设</a>,<a href="/jianshe#ym_websiteBox4" target="_blank">集团网站建设</a>,<a href="/jianshe#ym_websiteBox1" target="_blank">企业网站建设</a>,<a href="/jianshe#ym_websiteBox4_2" target="_blank">外贸网站建设</a>,<a href="/jianshe#ym_websiteBox4_3" target="_blank">响应式网站建设</a>,<a href="/weixin#item4" target="_blank">小程序开发</a>,<a href="/weixin" target="_blank">微信开发</a>,<a href="/jianshe#ym_websiteBox4_4" target="_blank">企业形象设计</a>,<a href="/jianshe#ym_websiteBox4_5" target="_blank">企业宣传视频</a>等服务,广皓图文建站位于彭州市龙岗区大运软件小镇,广皓图文建站拥有经验丰富的高级网站建设工程师和一流的网页高端设计人员,具备各种规模与类型网站建设的雄厚实力,在网站建设领域树立了自己独特的设计风格。 </div> <div class="friend-links"> <h6 class="clearfix"> <span class="tilte">友情链接</span> <a class="exchagne" href="http://wpa.qq.com/msgrd?v=3&uin=631063699&site=qq&menu=yes">交换友情链接</a> </h6> <div class="link-list clearfix"> <div class="link-slider"> <a href="https://www.cdxwcx.com/cloud/" title="云主机" target="_blank">云主机</a>   <a href="http://www.dzwzjz.com/" title="dzwzjz.com" target="_blank">dzwzjz.com</a>   <a href="http://www.cdkjz.cn/" title="成都网站设计" target="_blank">成都网站设计</a>   <a href="http://www.4006tel.net/yingxiao/" title="网络营销" target="_blank">网络营销</a>   <a href="https://www.cdcxhl.com/" title="成都网站建设公司" target="_blank">成都网站建设公司</a>   <a href="https://www.cdcxhl.com/ruanwen/yingxiao" title="软文发稿" target="_blank">软文发稿</a>   <a href="http://www.cxjianzhan.com/" title="网站制作" target="_blank">网站制作</a>   <a href="https://www.cdcxhl.com/idc/mintian.html" title="成都高电机柜租用" target="_blank">成都高电机柜租用</a>   <a href="https://www.cdcxhl.com/seo/chengdu.html" title="四川成都seo网站优化" target="_blank">四川成都seo网站优化</a>   <a href="http://www.pswzsj.com/" title="成都展台设计" target="_blank">成都展台设计</a>    </div> </div> </div> </div> <div class="footer-b"> <div class="f-box"> <ul> <li><a href="/jianshe#ym_websiteBox6" target="_blank">服务流程</a></li> <li><a href="/jianshe#ym_websiteBox8" target="_blank">售后服务</a></li> <li><a href="/about/" target="_blank">联系我们</a></li> <li><a href="https://www.cdxwcx.com/pay/" target="_blank">付款方式</a></li> <li><a href="https://www.cdcxhl.com/menu.html" target="_blank">网站地图</a></li> <li><a href="#" target="_blank">sitemap</a></li> <li> <p> <script data-cfasync="false" src="/Public/Home/js/email-decode.min.js"></script> </p> </li> <div style="clear:both;"></div> </ul> <p class="copy">Copyright © 2025 青羊区广皓图文设计工作室(个体工商户) 彭州建站工作室 All Rights Reserved   <a href="https://beian.miit.gov.cn/" target="_blank" rel="nofollow">蜀ICP备2025118593号-4</a> </p> <div style="clear:both;"></div> </div> </div> <div class="sj_footer"> <div class="f-box"> <ul> <li><a href="/jianshe" target="_blank">网站建设</a></li> <li><a href="/jianshe#ym_websiteBox6" target="_blank">服务流程</a></li> <li><a href="/jianshe#ym_websiteBox8" target="_blank">售后服务</a></li> <li><a href="https://www.cdxwcx.com/pay/" target="_blank">付款方式</a></li> <li><a href="/about/" target="_blank">关于我们</a></li> <li><a href="https://www.cdcxhl.com/menu.html" target="_blank">网站地图</a></li> <div style="clear:both;"></div> </ul> <p class="copy">Copyright © 2025 青羊区广皓图文设计工作室(个体工商户) 广皓图文网站建设——彭州站</p> <p class="copy"> <a href="https://beian.miit.gov.cn/" target="_blank" rel="nofollow">蜀ICP备2025118593号-4</a>  <a href="###" target="_blank"><img src="/Public/Home/images/govicon.gif" width="20" height="28" border="0" style="border-width:0px;border:hidden; border:none;"></a></p> <div style="clear:both;"></div> </div> </div> </div> <script type='text/javascript' src='/Public/Home/js/qqkefu.js'></script> <div class="qqkefu"> <ul> <li class="qq_czaa" id="130"><b class="a"></b>135-1821-9792</li> <li class="qq_czaa" id="130"><a href="tencent://message/?uin=1683211881"><b class="b"></b>业务咨询QQ</a></li> <li class="qq_czaa" id="130"><a href="javascript:showDiv()"><b class="f"></b>提交合作意向表</a></li> <li class="qq_czb"> <b class="c"></b> <div class="erweima"> <p><img src="/Public/Home/images/right_erweima.png"></p> </div> </li> <li class="top"><span></span></li> </ul> </div> <div id="popDiv" class="mydiv" style="display:none;"> <a class="mydiv_clk" href="javascript:closeDiv()">X</a> <div class="mydiv_list"> <div class="c_f_title"><span class="c_f_t">合作意向表</span></div> <div class="c_f_con"> <form id="form1" name="form1" class="mess_form" method="post" action="/post_order"> <input name='enews' type='hidden' value='AddFeedback'> <input name="bid" value="1" type="hidden"> <input type="hidden" name="ecmsfrom" value="9"> <input type="hidden" name='title' value="客户提交需求"> <li class="c_n"><span>公司名称</span> <dl><input name='gsname' id='gsname' type="text"></dl> </li> <li class="c_n"><span>邮箱</span> <dl><input name='gemail' id='gemail' type="text"></dl> </li> <li class="c_n xmm"> <div class="xmm_01"><span>姓名</span> <dl class="c_n_i"><input name='name' id='name' type="text"></dl> </div> <div class="xmm_01"><span style="text-align:center">电话</span> <dl class="c_n_i"><input name="tel" type="text"></dl> </div> </li> <li class="c_tser">您需要的服务</li> <li class="clearfix"> <dd><label><input type="radio" name='hobby' id='hobby' value="高端网站建设"><span>高端网站建设</span></label></dd> <dd><label><input type="radio" name='hobby' id='hobby' value="我需要做微信营销"><span>我需要做微信营销</span></label></dd> <dd><label><input type="radio" name='hobby' id='hobby' value="要找长期合作,需要年度服务"><span>要找长期合作,需要年度服务</span></label></dd> <dd><label><input type="radio" name='hobby' id='hobby' value="我需要做购物商城"><span>我需要做购物商城</span></label></dd> <dd><label><input type="radio" name='hobby' id='hobby' value="我需要网站改版"><span>我需要网站改版</span></label></dd> <dd><label><input type="radio" name='hobby' id='hobby' value="其他"><span>其他</span></label></dd> </li> <li class="c_tser">您关注的地方</li> <li class="clearfix"> <dd><label><input type="radio" name='hobby2' id='hobby2' value="对功能要求比较高"><span>对功能要求比较高</span></label></dd> <dd><label><input type="radio" name='hobby2' id='hobby2' value="对设计创意要求比较高"><span>对设计创意要求比较高</span></label></dd> <dd><label><input type="radio" name='hobby2' id='hobby2' value="需要可以购物支付"><span>需要可以购物支付</span></label></dd> <dd><label><input type="radio" name='hobby2' id='hobby2' value="搜索引擎排名"><span>搜索引擎排名</span></label></dd> </li> <li class="c_tser">预算</li> <li class="clearfix clearfix2"> <dd><label><input type="radio" name='hobby3' id='hobby3' value="一万以内"><span>一万以内</span></label> </dd> <dd><label><input type="radio" name='hobby3' id='hobby3' value="1-3万"><span>1-3万</span></label> </dd> <dd><label><input type="radio" name='hobby3' id='hobby3' value="3-5万"><span>3-5万</span></label> </dd> <dd><label><input type="radio" name='hobby3' id='hobby3' value="5万以上"><span>5万以上</span></label> </dd> <dd><label><input type="radio" name='hobby3' id='hobby3' value="需招投标"><span>需招投标</span></label> </dd> </li> <li class="c_n" style="border-top:1px solid #eee; padding-top:10px"><span>验证码</span> <dl class="c_n_i yzmm"><input type="text" name='code' id='code' value=""></dl><span style="text-align:center"><img src="/Public/Home/images/1661eb19783442c38063791555cd0d80.gif" onclick="this.src=this.src + '?'" width="100" height="40"></span> </li> <li class="clearfix"> <dd class="submit"><input name='submit' type="submit" value="提交需求"></dd> </li> </form> </div> </div> </div> <div id="bg" class="bg" style="display:none;"></div> <div id='popIframe' class='popIframe' frameborder='0'></div> <script> //提交需求选项 $(document).ready(function (e) { $(".mess_form").submit(function () { if ($("#gsname").val() == "") { alert("请填写您的公司名称!"); $("#gsname").focus(); return false; } if ($("#gemail").val() == "") { alert("请填写您的邮箱"); $("#gemail").focus(); return false; } if ($("#name").val() == "") { alert("请填写您的姓名!"); $("#name").focus(); return false; } if ($("#tel").val() == "") { alert("请填写您的电话!"); $("#tel").focus(); return false; } if ($("#hobby").val() == "") { alert("请选择您需要的服务!"); $("#hobby").focus(); return false; } if ($("#hobby2").val() == "") { alert("请选择您关注的地方!"); $("#hobby2").focus(); return false; } if ($("#hobby3").val() == "") { alert("请选择您的预算!"); $("#hobby3").focus(); return false; } if ($("#code").val() == "") { alert("请填写正确的验证码!"); $("#code").focus(); return false; } }); }); </script> <script language="javascript" type="text/javascript"> //提交需求窗口 function showDiv() { document.getElementById('popDiv').style.display = 'block'; document.getElementById('popIframe').style.display = 'block'; document.getElementById('bg').style.display = 'block'; } function closeDiv() { document.getElementById('popDiv').style.display = 'none'; document.getElementById('bg').style.display = 'none'; document.getElementById('popIframe').style.display = 'none'; } </script> <script type="text/javascript" src="/Public/Home/js/scrolltopcontrol.js"></script> <script type="text/javascript" src="/Public/Home/js/su_new.js"></script> </body> </html> <script> $(".con img").each(function(){ var src = $(this).attr("src"); //获取图片地址 var str=new RegExp("http"); var result=str.test(src); if(result==false){ var url = "https://www.cdcxhl.com"+src; //绝对路径 $(this).attr("src",url); } }); window.onload=function(){ document.oncontextmenu=function(){ return false; } } </script>