
python
MeGoodtoo
这个作者很懒,什么都没留下…
展开
-
python mysqlhelper
1,添加pymysql 依赖2,代码import pymysqlclass MySQLHelper: myVersion=0.1 def __init__(self,host,user,password,database,port=3306,charset="utf8"): self.host=host self.user=use...原创 2019-04-21 15:18:25 · 1276 阅读 · 0 评论 -
python 将url 相对地址转绝对地址
from urllib.parse import urljoinclass UrlCommon: def absoluteUrl(self,url,relatpath): return urljoin(url,relatpath)原创 2019-04-25 20:57:11 · 2341 阅读 · 0 评论 -
window 安装Scrapy
1,安装python 配置 环境变量PATH (注意 pywin32 没有 python 3.8 对应的版本 我用的是 python3.6.8)开始安装升级 pippython -m pip install --upgrade pip安装 wheelpip install wheel安装 twistedpip install twisted安装py...原创 2019-04-22 12:22:05 · 523 阅读 · 1 评论 -
python 处理 Html
from urllib.parse import urljoinfrom Common.PSoup import *class HtmlCommon: def handleHtmlString(self,htmlString,url,dic={}): psoup=PSoup() docBody=psoup.getPSoup(htmlString) bo...原创 2019-04-26 15:00:52 · 972 阅读 · 0 评论 -
python 基于 requests 发送 HTTP 请求
import requestsimport jsonclass HttpCommon: def get(self,url,encode): headers = { "Connection": "keep-alive", "Accept": "text/html,application/xhtml+xml,application/xml;q=0...原创 2019-04-25 16:52:33 · 502 阅读 · 0 评论