Jump to content

InetRead google page problem


Recommended Posts

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <String.au3>
#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("serp", 353, 194, 484, 358)
$Input1 = GUICtrlCreateInput("personal link", 2, 8, 140, 21)
$Input2 = GUICtrlCreateInput("keyword", 145, 8, 100, 21)
$Button1 = GUICtrlCreateButton("search", 250, 8, 75, 25)
$ListView1 = GUICtrlCreateListView("nr|link", 0, 40, 346, 150)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 50)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 270)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $Link = "https://www.google.ro/#newwindow=1&q="
            $Keyword = StringReplace(GUICtrlRead($Input2), " ", "+")
            $Parameter_search = "&start="
            $Page = "1"

            $Generate_link = $Link & $Keyword & $Parameter_search & $Page
            
            ConsoleWrite($Generate_link & @CRLF)
            
            $sData = BinaryToString(InetRead($Generate_link, 1))
            If Not @error Then
                ConsoleWrite($sData)
            EndIf

    EndSwitch
WEnd
 

I have a queries, do not understand why not go read html page ...

Can someone help me?

Thank you !

Link to comment
Share on other sites

I had similar issue before. I am not sure because of what it is falling from time to time when you start your connection from somehwere deep inside of the website. (www.domain.com/page/page/page).

 

The solution was simple for me. Just start from www.domain.com and then move on with another connection like (www.domain.com/page/page/page)

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...