Sign in to follow this  
Followers 0
Jos07

how to search for a text in webpage and close the windows ?

7 posts in this topic

#1 ·  Posted (edited)

hi, i could not understand about my problem please help me if you can.

If WinExists(\"Porn\") Then
WinClose(\"Porn\")
MsgBox($2, $M1, $MB)
ToolTip($TT2, 400, 300, $T5, 2, 2)
sleep($1)
ToolTip($T6, 400, 300, $T7, 2, 2)
sleep($3)
ToolTip(\"\", 0, 0, \"\", 0)
Sleep(0)
EndIf

i want to do this thing by searching and matching the text in webpage.

for example if i opened a webpage and its window title is Porn then it will surely close the window.

but how can i close it by searching the word Porn in webpage ?

many thanks for any help in advance.

Edited by Jos07

Always Keep Your Sig Small... Like me :D

Share this post


Link to post
Share on other sites

#2 ·  Posted (edited)

There are countless ways: like _IEBodyReadText search help file

But you do realize that this works only with IE!?! if user is using any other browser & window name does not have web page URL included it wont work!

I will tell you my favorite way: Hire you search page source code for porn:

Opt("WinTitleMatchMode", 2)     ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase

$var = ControlGetText(" - Windows Internet Explorer", "", "Edit1")

    $oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
    $oHTTP.Open("GET",$var) ; navigate to page where image is displayed 
    $oHTTP.Send()
    $HTMLSource = $oHTTP.Responsetext

    $_Arrayline = StringSplit($HTMLSource, @LF) ; this is the Array $_Arrayline we put the page source to array hire
    
        for $i = 1 to $_Arrayline[0] 
            If StringInStr($_Arrayline[$i],'porn') Then  MsgBox(0,'',$_Arrayline[$i])   ; search source for porn word
        Next
Edited by goldenix

My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]

Share this post


Link to post
Share on other sites

thanks for the help!

will you Please tell me now how to show message box and toolTip in this.

many thankses


Always Keep Your Sig Small... Like me :D

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

thanks for the help!

will you Please tell me now how to show message box and toolTip in this.

many thankses

Search help file for : MsgBox & ToolTip they have nice examples included ( Always search help file first, in many cases it has ready answers for you )

messagebox is already shown in my code, have you tried running it?

Edited by goldenix

My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]

Share this post


Link to post
Share on other sites

ya , its working now..

sorry for asking too much questions.

can i use the same functions for Mozilla firefox ?


Always Keep Your Sig Small... Like me :D

Share this post


Link to post
Share on other sites

can i use the same functions for Mozilla firefox ?

As I said, No you cant, searching for page source works only with IE.


My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]

Share this post


Link to post
Share on other sites

ok, now i have got the correct point.

Thanx!


Always Keep Your Sig Small... Like me :D

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