Sign in to follow this  
Followers 0
4b0082

Working in Hidden Browser Windows

5 posts in this topic

I'm trying to create a pretty simple program that checks for a specific string of text on a website every couple of minutes, but I've never worked with hidden browsers before and I'm not sure how to go about doing it.

My script's going to follow this basic programming:

  1. Open website.
  2. Scan for text.
  3. If text is found, open alert window.
  4. If text isn't found, wait five minutes and scan again.

I just want this to actively monitor a website in the background, but up to this point all of my experience is working with visually active, directly engaged windows. I want this program to essentially be invisible until it detects that string of text without interfering with anything else I'm doing.

Can someone point me in the right direction?

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Ugh I'm almost embarrassed to post this script, but here's what I'm working with so far using the InetRead page you mentioned.. I'm not sure if my script is actually doing what I think it's doing. Right now it should download the website in binary, convert it into a string (which is essentially viewing the site code), and then search for "$3." - if it finds that string, it alerts me that something has been found at $3, and if it doesn't find that string, it just keeps checking the page until that string appears.

I also have a concern that this script is essentially DDOSing the page because it's constantly downloading it (not something I want), so I'll add a Sleep line in there once someone tells me that I'm headed in the right direction.

I know this is probably a painfully sloppy way to go about doing what I'm trying to do, so I would love more input. :(

 

#include <IE.au3>
#include <MsgBoxConstants.au3>
#RequireAdmin

Func Market()
   Global $dData = InetRead("http://website.com")
   Global $sData = BinaryToString($dData)
   Global $iPosition = StringInStr($sData, "&#36;3.") ;&#36; is "$" in code-jargon.
EndFunc

Func Brain()
   Do
      Market()
   Until $iPosition <> "0"
   MsgBox(1, "Alert", "Something is cheaper than $4!")
EndFunc

Brain()
Edited by 4b0082

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

What you have so far should do the trick, just add a Sleep when nothing is found.

#include <IE.au3>
#RequireAdmin

Market()

Func Market()
    While 1
        $dData = InetRead("https://www.paidverts.com/")
        If StringInStr($dData, "$3") Then
            MsgBox(1, "Alert", "Something is cheaper than $4!")
            ExitLoop
        Else
            Sleep(30000)
        EndIf
    WEnd
EndFunc   ;==>Market
Edited by Palestinian

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Similar Content

    • BlazerV60
      By BlazerV60
      Hello all,
      I've written the code below which launches chrome in incognito mode and then proceeds to go to the autoit website.
      From my understanding, the Run() command is also supposed to output the PID number related to the application that got launched from the Run command.
      However when I run the below lines, it outputs a PID number that is different from the newly launched chrome browser's PID number, does anyone know why and possibly explain how I could retrieve the accurate PID number associated with the newly launched browser?
      Global $iPid = Run(@ComSpec & ' /c start chrome.exe https://www.autoitscript.com/forum/ -incognito' ,"", "") msgbox(0,"",$iPid) Thank you,
      Brian
    • BlazerV60
      By BlazerV60
      Hello all,
      I've been trying to figure out how to launch Google Chrome in the background (hidden) but it doesn't seem possible. I've tried the following methods:
      ShellExecute("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe", "", "", "", @SW_HIDE) Also I've tried:
      ShellExecute(@ComSpec, "/c start chrome.exe","","",@SW_HIDE) Lastly I tried:
      RunWait('"'&@ProgramFilesDir&'\Google\Chrome\Application\chrome.exe" --silent-launch',@ScriptDir)  
      But all of them launch my chrome browser without hiding it. Does anyone know a workaround for this or if AutoIT just can't Chrome? 
      Bonus points if you know how to make it launch chrome hidden and make it go to https://www.autoitscript.com
       
      Thank you,
      Brian
    • BOUNCER
      By BOUNCER
      I'm trying to get the output data from https://www.guilded.gg but it uses a web app that generates that output on the fly and this doesn't show up in the page source.
      Only in web inspector of each browser does this data show up. How do I read this data in autoit (equivalent to the web inspector)
       
      thank you
    • ur
      By ur
      We can select elements in IE using their IDs as below.
      Local $oDiv = _IEGetObjById($oIE, "x-auto-16-input") But to one button in the webpage, there is no ID to it.
      In selenium we have option to select this element using the CssSelector and clicked the button using below code in c# selenium.
      driver.FindElement(By.CssSelector("button.x-btn-text")).Click(); What is the alternative for this in AUtoIT?