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. pg_resetxlog - 重置一个 PostgreSQL 数据库集群的预写日志以及其它控制内容

    SYNOPSIS pg_resetxlog [ -f ] [ -n ] [ -o oid] [ -x xid] [ -l fileid,seg] datadir DESCRIPTION 描述 pg_r ...

  2. Linux系统Docker启动问题Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service"

    在Liunx中使用Docker, 注: Liunx使用的是在虚拟机下的centOS7版本在刚开始安装Docker时没有任何错误, 但是在后续的docker启动过程中, 出现以下问题: [root@zk ...

  3. OGG-01161

    Bad column index (35) specified for table user.table_name, max columns = 35. 原因:源端表结构发生了变更 解决办法:1.如果 ...

  4. flask之环境的搭建

    一.查看ubantu上是否安装虚拟环境的包 virtualenv --version 这里显示的是:15.0.1的版本,如果没有的话, sudo pip install virtualenv sudo ...

  5. LeetCode--049--字母异位词分组(java)

    给定一个字符串数组,将字母异位词组合在一起.字母异位词指字母相同,但排列不同的字符串. 示例: 输入: ["eat", "tea", "tan&quo ...

  6. HashMap测试程序1

    package com.iotek.map; import java.util.Collection;import java.util.HashMap;import java.util.Map;imp ...

  7. MapServer教程2

    第二章 Tutorial 教程 MapServer Tutorial MapServer教程 Tutorial background 教程背景 Section 1: Static Maps and t ...

  8. python保存selenium的cookies写入和读出

    def write_cookie(self, cookie): try: with open("cookies%s" % self.uid, "wb+") as ...

  9. 在java中

    // 进入prompt回调 public class JSBridgeWebChromeClient extends WebChromeClient { @Override public boolea ...

  10. 牛客提高D4t2 卖羊驼

    分析 不难想到dp[i][j]表示前i个数分了j组的最大值 我们发现这个dp状态有决策单调性 g[i][j]表示对于第i个数它的第j位最近出现的位置 每次一定从这些点转移 预处理即可 似乎还可以做到1 ...