• python常用库


    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
  • 相关阅读:
    tarjan——强连通分量+缩点
    题解报告——Financial Crisis
    计算几何刷题计划(转)
    [bzoj1042] [HAOI2008]硬币购物
    [bzoj1584] [Usaco2009 Mar]Cleaning Up 打扫卫生
    bzoj 2783 JLOI2012 树
    bzoj 1150 [CTSC2007]数据备份Backup
    bzoj 1079 [SCOI2008]着色方案
    bzoj 2957 楼房重建
    bzoj 3208 花神的秒题计划I
  • 原文地址:https://www.cnblogs.com/tekikesyo/p/11096674.html
Copyright © 2020-2023  润新知