Jump to content

Working in Hidden Browser Windows


4b0082
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
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
 Share

×
×
  • Create New...