首页 > 编程语言 > 详细

python常用库

时间:2019-06-27 14:41:10      阅读:96      评论:0      收藏:0      [点我收藏+]
1.json
import json
dump, load

2.import pickle
https://www.cnblogs.com/buildydream/p/10171938.html

http://www.75271.com/11505.html

3. byte<-->str
import sys
encode, decoce

4.url encode/decode
import urllib.parse
https://www.cnblogs.com/caicaihong/p/5687522.html
urllib.parse.quote(s)
urllib.parse.unquote(s)

urllib.parse.urlencode(values)

5.webdriver
https://selenium-python.readthedocs.io/
pip install selenium
####################################
from selenium import webdriver
from selenium.webdriver.common.keys import Keys

browser = webdriver.Firefox()
browser.get(http://www.yahoo.com)
assert Yahoo in browser.title
elem = browser.find_element_by_name(p)  # Find the search box
elem.send_keys(seleniumhq + Keys.RETURN)
browser.quit()
####################################
https://pypi.org/project/selenium/
https://qiita.com/kinpira/items/383b0fbee6bf229ea03d

6.获取cookie
# 获取cookie列表
browser = webdriver.Chrome()
browser.get("http://xxxxxx")
cookie_list = browser.get_cookies()
# 格式化打印cookie
for cookie in cookie_list:
   val=cookie[value]
    print(cookie[name], "--", urllib.parse.unquote(val))

##########################################
https://www.cnblogs.com/lizm166/p/10008634.html

 

python常用库

原文:https://www.cnblogs.com/tekikesyo/p/11096674.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!