Jump to content

Downloading src image in web


 Share

Recommended Posts

I mean here to downloaded the src of the image and paste it to $ hrefs

Here is the code from image to download scr.

<div id="images" style="width: 300px; height: 57px; "><img style="display:block;" height="57" width="300" src="http://www.nk.pl/images/new"></div>

$hrefs = ... ;where (...) is the image src
Edited by metis
Link to comment
Share on other sites

I mean here to downloaded the src of the image and paste it to $ hrefs

Hello,

Here just an example:

$sText = '<div id="images" style="width: 300px; height: 57px; "><img style="display:block;" height="57" width="300" src="http://www.nk.pl/images/new"></div>'
$array = StringRegExp($sText,'(?i)src="(.*)"',1)
If @error Then
    ConsoleWrite("No matches found" & @CRLF)
Else
    $href = $array[0]
    ConsoleWrite("I've found this: " & $href & @CRLF)
EndIf

Above example will match only once, i.e. if there are more patterns (src="*") it will only match the first one... take a look to StringRegExp.

One more thing, if you need to get the source from the web page then take a peek to _INetGetSource.

Link to comment
Share on other sites

Me all code

#include <ff.au3>
#include <string.au3>
_FFConnect()
_FFStart("www.nk.pl")

$sText = _FFReadHtml()
;There needs to look for from the moment that is /html/body/div[3]/div/div/div/div/a
$array = StringRegExp($sText,'(?i)src="(.*)"',1)
If @error Then
    ConsoleWrite("No matches found" & @CRLF)
Else
    $href = $array[0]
    ConsoleWrite("I've found this: " & $href & @CRLF)
EndIf
;It is the task I see logos servisu scr
Edited by metis
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...