摘要: 替换换行符: update qgnews set article_url=REPLACE(article_url,char(10),'') 替换回车符: update qgnews set article_url=REPLACE(article_url,char(13),'') 阅读全文
posted @ 2020-02-21 16:01 myrj 阅读(126) 评论(0) 推荐(0)
摘要: from selenium.webdriver.chrome.options import Options from selenium import webdriver wd = webdriver.Chrome()#打开有界面浏览器 wd.maximize_window()#最大化浏览器 wd.e 阅读全文
posted @ 2020-02-19 10:04 myrj 阅读(819) 评论(0) 推荐(0)
摘要: 方法一:import sysimport osBASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))sys.path.append(BASE_DIR)方法二:import sys,osprint(sys.path# 阅读全文
posted @ 2020-02-18 16:53 myrj 阅读(152) 评论(0) 推荐(0)
摘要: {accept:application/json, text/plain, */*,accept-encoding:gzip, deflate, br,accept-language:zh-CN,zh;q=0.9,cookie:WEIBOCN_WM=3349; H5_wentry=H5; backU 阅读全文
posted @ 2020-02-18 11:32 myrj 阅读(2577) 评论(0) 推荐(0)
摘要: import re ab='''ms: [["", "\u7acb\u5373\u4e0b\u8f7d"], ["", "\u5207\u6362\u81f3\u4e2a\u4eba\u8d26\u53f7\u4e0b\u8f7d"],''' ab=re.sub(r' +','',ab) #将ab中 阅读全文
posted @ 2020-02-17 15:35 myrj 阅读(159) 评论(0) 推荐(0)
摘要: pip install python.docx from docx import DocumentDoc = Document() 解释:from 从 docx这个文件中,导入一个叫Document的一个东西,Document是文档的意思,所以它是对word文档进行操作的一个玩意. 在下面Doc = 阅读全文
posted @ 2020-02-17 07:14 myrj 阅读(211) 评论(0) 推荐(0)
摘要: import requests rr=requests.get("https://api.github.com",auth=('user','pass')) print(rr.status_code) print(rr.headers['content-type']) 结果: RESTART: D: 阅读全文
posted @ 2020-02-16 18:19 myrj 阅读(147) 评论(0) 推荐(0)
摘要: urls=[f'https://www.baidu.com/?page={page}' for page in range(1,5)] #F f大小写都可以 print(urls) page=10 url='https://www.baidu.com/?page={}'.format(page) p 阅读全文
posted @ 2020-02-16 16:43 myrj 阅读(206) 评论(0) 推荐(0)
摘要: >>> b=(page for page in range(10))>>> print(b)<generator object <genexpr> at 0x0000000002EE61C8>>>> list(b) #只能生成一次[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]>>> l 阅读全文
posted @ 2020-02-16 16:32 myrj 阅读(467) 评论(0) 推荐(0)
摘要: >>> a=[page for page in range(10)]>>> print (a)[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]>>> a=[page*2 for page in range(10)]>>> print(a)[0, 2, 4, 6, 8, 10, 12, 1 阅读全文
posted @ 2020-02-16 16:24 myrj 阅读(168) 评论(0) 推荐(0)