Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
# -*- coding: utf-8 -*-
from scanForm import getParams
import time
from selenium import webdriver
def vueGetParams(url, cookie = {}, localStorage = {}):
option = webdriver.ChromeOptions()
option.add_argument('headless')
driver = webdriver.Chrome(options = option)
driver.get(url)
if localStorage:
for eachKey in localStorage.keys():
driver.execute_script("localStorage.setItem('%s', '%s')" % (eachKey, localStorage[eachKey]))
driver.refresh()
html = driver.page_source
driver.quit()
return getParams(html, cookie, True)[0]
if __name__ == '__main__':
url = "http://10.21.142.235:8080/"
data = {'vuex': '{"user":{"userInfo":{"username":"test","IsAdmin":false,"uuid":"d3fdc539-a242-441a-91c0-e1b59bcd4e38","email":"a@a.wwa"},"token":"asdasdasd","expiresAt":"2020/10/16"}}'}
print(vueGetParams(url, localStorage = data))