在网址中写问号

时间:2019-06-15 12:22:57

标签: python-3.x pyautogui

我正在使用pyautogui执行一些例程。 我正在尝试编写一个包含“?”的网址但是此字符未写在网址中,该怎么办?

在我的代码下面

import pyautogui as m
    #from requests.utils import requote_uri
    st = '?'
    url = 'http://10.100.0.34/Relatorios/Pages/Report.aspx? 
    ItemPath=%2fDBM%2fGrafico+Espa%c3%a7o+Servidores'

    print(url)

def checklist():
    m.moveTo(27,882,duration=1)
    m.click(27,882)
    m.moveTo(115,269,duration=1)
    m.click(115,269)
    m.moveTo(128,37,duration=1)
    m.click(128,37)
    m.typewrite(url,interval=0.02)
    m.press('enter')

checklist()

输出     Routing with parameters in jade from one page to another

1 个答案:

答案 0 :(得分:0)

我一直在尝试重新创建问题,但是我似乎无法弄清导致问题的原因,因为在我的电脑上一切正常。尝试增加间隔或将代码分成这样的部分

typewrite('http://10.100.0.34/Relatorios/Pages/Report.aspx'+'?'+'ItemPath=%2f 
DBM%2fGrafico+Espa%c3%a7o+Servidores')

还尝试在typewrite函数之前添加time.sleep(),可能是m.click()引起了问题。