【问题标题】:python script to click buttonpython脚本单击按钮
【发布时间】:2013-03-20 03:18:01
【问题描述】:

我让这个 cod 为一个游戏网站工作了很长时间,但现在他们改变了点击它的方式:-

def formRaid():
    #print formerID
    one = 1
    while one == 1:
        try:
            global _startTime
            _startTime = datetime.datetime.now()

            formpage = alo("http://"+server+".outwar.com/formraid.php?target=" + bossToRaidId+"&suid="+FORMER_ID).read()
            codeID = formpage.split('codeid" value="')[1].split('">')[0]

            Form = alo2("http://"+server+".outwar.com/formraid.php?target=" + bossToRaidId, "target=" + bossToRaidId + "&codeid=" + codeID + "&formtime=3&submit=Launch!").read()

            global RAID_ID, RAID_NAME
            RAID_ID = getRaidID(Form)
            RAID_NAME = getRaidName(Form)

            print ""
            print "***" + RAID_NAME + " Formed."
            one = 0
            return True

        except IndexError:
            print "Forming Error, retrying...."
            time.sleep(1)

现在我必须单击一个按钮才能再次进入,该按钮的信息是:-

<input type="submit" value="Join this Raid!" name="submit">

我如何进行点击:-

formpage = alo("http://"+server+".outwar.com/formraid.php?target=" + bossToRaidId+"&suid="+FORMER_ID).read()
codeID = formpage.split('codeid" value="')[1].split('">')[0]

或在 :-

中使用的那个
Form = alo2("http://"+server+".outwar.com/formraid.php?target=" + bossToRaidId, "target=" + bossToRaidId + "&codeid=" + codeID + "&formtime=3&submit=Launch!").read()

点击那个按钮而不是它之前所做的??

【问题讨论】:

  • 按钮是表单的一部分吗?表单指向什么 URL?

标签: python button scripting web click


【解决方案1】:

opener.open("http://"+server+".outwar.com/formraid.php?target=" + bossToRaidId + "&suid="+FORMER_ID, "formtime=3&message=&bomb=none&submit=Launch!" )

仅适用于 2.7 python

【讨论】:

    猜你喜欢
    • 2020-12-26
    • 2013-02-15
    • 2018-03-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多