import requests
from lxml import etree
import csv for i in range(10, 990, 10): url = "http://124.128.84.60:7008/iaicweb/xxcx/doqylccx.jsp?start=%s" % (str(i)) response = requests.get(url)
html = etree.HTML(response.text) content_list = html.xpath('//td[@align="center"]/table[@border="1"]//tr[not(@class="tc")]') for content in content_list[:-2]:
try:
banlishixiang = content.xpath('./td[not(@colspan="4")]/text()')[0]
shendingdanwei = content.xpath('./td[not(@colspan="4")]/text()')[1]
banliriqi = content.xpath('./td[not(@colspan="4")]/text()')[2]
banlizhuangtai = content.xpath('./td[not(@colspan="4")]/text()')[3] with open('./登记业务.csv', 'a', encoding='utf-8') as f:
csv_write = csv.writer(f)
rows = [banlishixiang, shendingdanwei, banliriqi, banlizhuangtai]
csv_write.writerow(rows) except:
continue

  

python爬取企业登记业务的更多相关文章

  1. Python 爬取所有51VOA网站的Learn a words文本及mp3音频

    Python 爬取所有51VOA网站的Learn a words文本及mp3音频 #!/usr/bin/env python # -*- coding: utf-8 -*- #Python 爬取所有5 ...

  2. python爬取网站数据

    开学前接了一个任务,内容是从网上爬取特定属性的数据.正好之前学了python,练练手. 编码问题 因为涉及到中文,所以必然地涉及到了编码的问题,这一次借这个机会算是彻底搞清楚了. 问题要从文字的编码讲 ...

  3. python爬取某个网页的图片-如百度贴吧

    python爬取某个网页的图片-如百度贴吧 作者:vpoet mail:vpoet_sir@163.com 注:随意copy,不用告诉我 #coding:utf-8 import urllib imp ...

  4. Python:爬取乌云厂商列表,使用BeautifulSoup解析

    在SSS论坛看到有人写的Python爬取乌云厂商,想练一下手,就照着重新写了一遍 原帖:http://bbs.sssie.com/thread-965-1-1.html #coding:utf- im ...

  5. 使用python爬取MedSci上的期刊信息

    使用python爬取medsci上的期刊信息,通过设定条件,然后获取相应的期刊的的影响因子排名,期刊名称,英文全称和影响因子.主要过程如下: 首先,通过分析网站http://www.medsci.cn ...

  6. python爬取免费优质IP归属地查询接口

    python爬取免费优质IP归属地查询接口 具体不表,我今天要做的工作就是: 需要将数据库中大量ip查询出起归属地 刚开始感觉好简单啊,毕竟只需要从百度找个免费接口然后来个python脚本跑一晚上就o ...

  7. Python爬取豆瓣指定书籍的短评

    Python爬取豆瓣指定书籍的短评 #!/usr/bin/python # coding=utf-8 import re import sys import time import random im ...

  8. python爬取网页的通用代码框架

    python爬取网页的通用代码框架: def getHTMLText(url):#参数code缺省值为‘utf-8’(编码方式) try: r=requests.get(url,timeout=30) ...

  9. 没有内涵段子可以刷了,利用Python爬取段友之家贴吧图片和小视频(含源码)

    由于最新的视频整顿风波,内涵段子APP被迫关闭,广大段友无家可归,但是最近发现了一个"段友"的app,版本更新也挺快,正在号召广大段友回家,如下图,有兴趣的可以下载看看(ps:我不 ...

随机推荐

  1. vim ctags

    ctags -I __THROW -I __attribute_pure__ -I __nonnull -I __attribute__ --file-scope=yes --langmap=c:+. ...

  2. netcore中使用session

  3. nginx+flask+gevent+uwsgi实现websocket

    Websocket简介 WebSocket是HTML5开始提供的一种在单个 TCP 连接上进行全双工通讯的协议.在WebSocket API中,浏览器和服务器只需要做一个握手的动作,然后,浏览器和服务 ...

  4. php 调用远程url

    // ; Whether to allow the treatment of URLs (like http:// or ftp://) as files. // ; http://php.net/a ...

  5. jmeter性能工具 之 传参 (三)

    jmeter 主要有三种方式:键值对传参,json格式传参,外部传参 1.键值对传参 可以参考上篇登陆,使用的传参方式是键值对传参  2.json 格式传参 用json 格式传参不要忘了加http 头 ...

  6. [POJ 1390] Blocking

    问题描述 Some of you may have played a game called 'Blocks'. There are n blocks in a row, each box has a ...

  7. 【leetcode】1043. Partition Array for Maximum Sum

    题目如下: Given an integer array A, you partition the array into (contiguous) subarrays of length at mos ...

  8. Linux find过滤掉没有查看权限的文件

    参考:https://blog.csdn.net/sinat_39416814/article/details/84993424 https://www.jianshu.com/p/2b056e1c0 ...

  9. php in_array()函数 语法

    php in_array()函数 语法 作用:搜索数组中是否存在指定的值.大理石机械构件价格 语法:in_array(search,array,type) 参数: 参数 描述 search 必需.规定 ...

  10. 状态管理Vuex的使用总结

    1.Vuex.store 的基本使用 Vuex 是一个专为 Vue.js 应用程序开发的状态管理模式,它采用集中式存储管理应用的所有组件的状态,并以相应的规则保证状态以一种可预测的方式发生变化. Vu ...