python爬取aspx数据
【摘要】 参考:
https://github.com/lxl0928/ricedata_spider
# coding: utf-8 import jsonimport urllib.requestfrom datetime import datetimefrom collections import OrderedDict import requestsfrom...
参考:
https://github.com/lxl0928/ricedata_spider
-
# coding: utf-8
-
-
import json
-
import urllib.request
-
from datetime import datetime
-
from collections import OrderedDict
-
-
import requests
-
from lxml import etree
-
-
cnt_now = datetime.now()
-
cnt_time = "{}{}{}{}{}".format(cnt_now.year, cnt_now.month, cnt_now.day, cnt_now.hour, cnt_now.minute)
-
-
url = "http://www.ricedata.cn/gene/accessions_switch.aspx?p={}&cloned=true"
-
user_agent = "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)"
-
headers = {"User-Agent": user_agent}
-
-
result_path = "./doc/{}.xlsx".format(cnt_time)
-
xls_data = OrderedDict()
-
result_biao = []
-
-
# 存储目标数据结构
-
result_data = dict()
-
-
# 确定每列的标题
-
result_data['title'] = ["GeneID", "基因名称或注释", "基因符号", "RAP_Locus", "MSU_Locus", "cDNAs
文章来源: blog.csdn.net,作者:网奇,版权归原作者所有,如需转载,请联系作者。
原文链接:blog.csdn.net/jacke121/article/details/108091163
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)