webautomation

Python, mechanize, proper syntax for setting multiple headers?

杀马特。学长 韩版系。学妹 提交于 2019-11-28 00:28:36
问题 I can't seem to find how to do this anywere, I am trying to set multiple headers with python's mechanize module, such as: br.addheaders = [('user-agent', ' Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.3) Gecko/20100423 Ubuntu/10.04 (lucid) Firefox/3.6.3')] br.addheaders = [('accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')] But it seems that it only takes the last br.addheaders.. so it only shows the 'accept' header, not the 'user-agent' header, which leads me

Textbox events?

六月ゝ 毕业季﹏ 提交于 2019-11-27 19:37:47
问题 I am using Kantu to automate filling out some forms. There is a textbox that when a persons id number is entered and you click into another box or tab out of the textbox it will load that persons vcard. I can try to expound if you need more clarity. I don't know much but i'm guessing me clicking into another box is activiating some kind of event to load this vcard. I can't seem to simulate this. Does anyone know of a way to do so? 回答1: Welcome to SO. There are different option to get the

Execute javascript trough Internet Explorer's com interface using PowerShell

≡放荡痞女 提交于 2019-11-27 16:42:41
问题 I am writing some Internet Explorer automation scripts using PowerShell. Here is how I start the IE com object: $ie = New-Object -com "InternetExplorer.Application" $ie.Navigate("about:blank") $ie.visible = $true $doc = $ie.Document So, what I would like to do is to execute some javascript on the $doc object. For example, I have an item on the page that has an onclick event which executes "submitCommand('lookup')", so I'd like to run that directly on the $doc instead of having to find the

headless internet browser? [closed]

穿精又带淫゛_ 提交于 2019-11-26 03:16:26
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I would like to do the following. Log into a website, click a couple of specific links, then click a download link. I\'d like to run