Results 1 to 4 of 4
  1. #1
    redkevin25's Avatar
    Join Date
    Jan 2009
    Gender
    male
    Posts
    206
    Reputation
    10
    Thanks
    124
    My Mood
    Amused

    [help]GetElement

    Hi,

    Can please sombody write a script so me program gets this "value"

    <param name="movie" value="https://games2.spele.nl/swf/1/9/0/8/1/0.swf" />

    I tested thiss

    webbrowser1.document.getelementbyid("movie").getat tribude("value")

    But it doenst works

    Can you or sombody help me thnx

  2. #2
    Lonely Tedy Bear's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Location
    Utah,Salt Lake Posts: 5,371 ►►►►Lonely-Tedy◄◄◄◄
    Posts
    1,541
    Reputation
    -151
    Thanks
    321
    My Mood
    Lonely
    is this a textbox or label ? anyways try this
    Code:
     /your text box or string here\ WebBrowser1.Document.All("ID").GetAttribute("value")
             

  3. #3
    Hawky1337's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    88
    Reputation
    11
    Thanks
    27
    My Mood
    Shocked
    Use a stringbetween function(see snippets) or google.

  4. The Following User Says Thank You to Hawky1337 For This Useful Post:

    NextGen1 (08-29-2010)

  5. #4
    Imported's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    142
    Reputation
    27
    Thanks
    47
    My Mood
    Relaxed
    I'm not sure if this is the most efficient way, but it's a method you could use.

    (NOTE: When I was writing this function I tried to make it as broad as possible, you will likely need to fine tune it to suit your specific needs.)

    Okay first, we need to get the page source of the page you're trying to extract info from, here's a little function that can retrieve the page source for you:

    [php]
    Private Function GetPageSource(ByVal URl As String) As String
    Dim PageSource As String = ""

    Try
    Dim webReq As HttpWebRequest = WebRequest.Create(URl)
    Dim webResponse As HttpWebResponse = webReq.GetResponse

    Using sRead As New StreamReader(webResponse.GetResponseStream)
    PageSource = sRead.ReadToEnd
    End Using

    Catch ex As Exception
    MsgBox("error with source")

    End Try

    Return PageSource

    End Function
    [/php]

    Okay now that we can get the source, we need to extract the text between two point, here's a function I just wrote up then specifically for this to easily obtain text between two points:

    [php]
    Private Function ExtractLine(ByVal WebPage As String, ByVal IndexOnLine As String, ByVal finalIndex As String)

    Dim Extracted As String = ""
    Dim TempFile As String = My.Computer.FileSystem.GetTempFileName & Rnd() * 99999 & ".txt"
    My.Computer.FileSystem.WriteAllText(TempFile, GetPageSource(WebPage), False)

    Using sReader As New StreamReader(TempFile)
    Do Until sReader.EndOfStream
    Dim CurrentLine As String = sReader.ReadLine
    If CurrentLine.Contains(IndexOnLine) Then
    Dim LIO As Integer = CurrentLine.LastIndexOf(finalIndex)
    Dim FI As Integer = CurrentLine.IndexOf(IndexOnLine) + IndexOnLine.Length
    Extracted = CurrentLine.Substring(FI, LIO - FI)
    End If
    Loop
    End Using

    Return Extracted

    End Function
    [/php]

    Okay once you've added that function in, you need to call it somewhere. I.e from a button_click event:

    [php]
    Dim extractedInfo As String = ExtractLine("https://www.example.com/blah.aspx", "<param name=""movie""value=", " />")
    MsgBox(extractedInfo)
    [/php]

    In this case the messagebox will say:

    Code:
     "https://games2.spele.nl/swf/1/9/0/8/1/0.swf"
    I hope that helps you a bit, if you have questions feel free to ask.

    First post, yay!

Similar Threads

  1. [Help Request] Combat arms Vid help
    By djw111 in forum Combat Arms Help
    Replies: 4
    Last Post: 12-24-2011, 05:06 PM
  2. [Help Request] AFK Bot [help]
    By fet in forum Combat Arms Help
    Replies: 7
    Last Post: 04-28-2011, 03:17 AM
  3. [Help Request] Injector Admin help
    By asdfgas in forum Combat Arms Help
    Replies: 4
    Last Post: 04-27-2011, 06:12 PM
  4. [Help Request] Ajuda / Help
    By - Battery' in forum Combat Arms BR Coding Help
    Replies: 3
    Last Post: 04-22-2011, 07:15 PM
  5. [Help Request] Help my!
    By Windowns7 in forum Combat Arms BR Coding Help
    Replies: 2
    Last Post: 04-18-2011, 01:41 PM