metis Posted March 13, 2011 Posted March 13, 2011 (edited) 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 March 13, 2011 by metis
sahsanu Posted March 14, 2011 Posted March 14, 2011 I mean here to downloaded the src of the image and paste it to $ hrefsHello,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) EndIfAbove 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.
Zedna Posted March 14, 2011 Posted March 14, 2011 Look at this function #include <IE.au3> _IEImgGetCollection ( ... ) Resources UDF ResourcesEx UDF AutoIt Forum Search
metis Posted March 14, 2011 Author Posted March 14, 2011 UP @ The problem is that as operating on Firefox (_FF) UP2 @ Thanks. How do I set it to read it just a picture. xpath img = /html/body/div[3]/div/div/div/div/a/img
sahsanu Posted March 14, 2011 Posted March 14, 2011 UP2 @ Thanks. How do I set it to read it just a picture.xpath img = /html/body/div[3]/div/div/div/div/a/imgSorry but I don't understand what do you need.
metis Posted March 14, 2011 Author Posted March 14, 2011 I mean to look for from that moment the first image (src)
sahsanu Posted March 14, 2011 Posted March 14, 2011 I mean to look for from that moment the first image (src)Please, paste a real example so I can figure out how to try to solve your issue.
metis Posted March 14, 2011 Author Posted March 14, 2011 (edited) 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 March 14, 2011 by metis
sahsanu Posted March 14, 2011 Posted March 14, 2011 Hi again, If the image you need to get is "http://0.s-nk.pl/img/new_logo_standard_2010" then change your script: From: $array = StringRegExp($sText,'(?i)src="(.*)"',1) To: $array = StringRegExp($sText,'(?i)img src="(.*?)"',1)
metis Posted March 14, 2011 Author Posted March 14, 2011 Never mind. I need to begin looking for the given object / / html / body / div [3] / div / div / div / div / a know how to do it?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now