我将如何编程我的机器人以清除占位符书写? [英] How would I program my bot to clear away placeholder writing?

查看:160
本文介绍了我将如何编程我的机器人以清除占位符书写?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个使用普通的旧Windows记事本登录bing.com的机器人,到目前为止,我已经拥有了:

I'm making a bot to log in to bing.com using plain old windows notepad, and so far, I have this:

set wb = createobject("internetexplorer.application")
wb.statusbar = false
wb.menubar = false
wb.toolbar = false
wb.visible = true

wb.navigate("https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=13&ct=1511575188&rver=6.7.6631.0&wp=MBI&wreply=https%3a%2f%2fwww.bing.com%2fsecure%2fPassport.aspx%3frequrl%3dhttps%253a%252f%252fwww.bing.com%252f%253fwlexpsignin%253d1&lc=1033&id=264960&CSRFToken=3f67b462-bf5b-4492-9925-e583298a3350&aadredir=1")

wscript.sleep(5000)

wb.document.all.item("i0116").value = "asdf1234@gmail.com"

wscript.sleep(100)

但是,当应该在我的电子邮件中输入的行"asdf1234@gmail.com"运行时,会出现一团乱七八糟的东西.

But, when the line that is supposed to type in my email "asdf1234@gmail.com" runs, a jumbled mess of stuff appears.

最初,框中会出现诸如电子邮件,电话号码或Skype"之类的单词,您应该单击它并键入您的电子邮件.但是,当我的机器人执行此操作时,我的电子邮件和占位符文本"会混在一起,并产生确实很奇怪的随机字符.

Originally, there are words in the box like "Email, phone number, or Skype" and you're supposed to click on it and type your email. But, when my bot does it, my email and the "placeholder text" mash together and produce random characters that are really weird.

我尝试查找占位符文本的ID,以便可以通过查看inspect元素来对其进行操作,但是我似乎无能为力.

I tried finding the id for the placeholder text so I can manipulate it by looking in inspect element, but I can't seem to do anything.

我真的是机器人编写的新手,如果有人可以提供帮助,我将非常感激.预先感谢!

I'm really new to bot writing, and if anybody could help, I would greatly appreciate it. Thanks in advance!

推荐答案

添加此行以隐藏提示文本

Add this line to hide the hint text

wb.document.getElementsByClassName("phholder")(0).style.display = "none"

我也可以建议用

Do While true
    if wb.readystate = 4 then exit do
    wscript.sleep(100)
Loop

哪些应该等到页面加载完毕.

Which should just wait until the page is loaded.

这篇关于我将如何编程我的机器人以清除占位符书写?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆