1 Star 1 Fork 5

巴挂/爬虫-1688商品详情数据

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
load_file.py 769 Bytes
一键复制 编辑 原始数据 按行查看 历史
gebinda 提交于 2021-07-08 18:27 . 重构
# -*- coding: utf-8 -*-
import json
class obj11:
pass
fileName = "state.txt"
fileName1 = "url/pageUrl.txt"
def set_state(count,pagination):
file = open(fileName,"w")
txt = "count=" + str(count) + "," + 'pagination=' + str(pagination)
file.write(txt)
file.close()
def get_state():
file1 = open(fileName,"r")
txt = file1.read()
arr = txt.split(',')
obj = obj11()
for item in arr:
setattr(obj,item.split('=')[0],item.split('=')[1])
file1.close()
return obj
# set_state(12,222)
# aa = get_state()
# print(aa.count)
def set_url_list(txt):
file = open(fileName1,"w")
file.write(json.dumps(txt))
file.close()
def get_url_list():
file1 = open(fileName1,"r")
txt = file1.read()
return json.loads(txt)
li = get_url_list()
print(li)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/baguLoveLHY/crawler-1688-product-details.git
git@gitee.com:baguLoveLHY/crawler-1688-product-details.git
baguLoveLHY
crawler-1688-product-details
爬虫-1688商品详情数据
master

搜索帮助