anystupidassname Posted August 11, 2005 Share Posted August 11, 2005 Assuming I'm using the InetGetSource UDF to get a list of links on the page, how could I use regex to pick the link I'm interested in assuming it will always be the only one to end in a certain way (lets say $var for example) Thanks! This signature is computer generated, nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#....... Link to comment Share on other sites More sharing options...
w0uter Posted August 11, 2005 Share Posted August 11, 2005 could you give more info like an example site and what link you actually want to pick out. if your looking for some regex exampels check my sig out (_Google & _InetGetImage) My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
seandisanti Posted August 11, 2005 Share Posted August 11, 2005 Assuming I'm using the InetGetSource UDF to get a list of links on the page, how could I use regex to pick the link I'm interested in assuming it will always be the only one to end in a certain way (lets say $var for example) Thanks!<{POST_SNAPBACK}>I think i'm going to have to impose a limit on myself of how many times in a day i can say 'check out dale's ie.au3 to do this easier' Link to comment Share on other sites More sharing options...
Zedna Posted August 11, 2005 Share Posted August 11, 2005 Here is my similar code snipet: ; my sample html source snipet $html_src = '<A href="data/0507211530.gif">15:30</A> | <A href="data/0507211500.gif">15:00</A> | ...' $names = StringRegExp($html_src, '(?i)<A href="data/(.*?)">', 3); (?i) -> case insensitive If @Error <> 0 or @extended <> 1 Then MsgBox(48, "Error", "Error finding links on the page!") Exit Else MsgBox(48, "OK", "Number of links on the page is " & UBound($names)) EndIf Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
w0uter Posted August 11, 2005 Share Posted August 11, 2005 code is kinda wrong. what if there are other tags between A and href. and what if they use ' instead of " My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
anystupidassname Posted August 12, 2005 Author Share Posted August 12, 2005 (edited) could you give more info like an example site and what link you actually want to pick out.if your looking for some regex exampels check my sig out (_Google & _InetGetImage)<{POST_SNAPBACK}>For example the windows-intel file on this pageblah, assume you don't have to click yes twice and pick daily dat only... Edited August 12, 2005 by anystupidassname This signature is computer generated, nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#....... Link to comment Share on other sites More sharing options...
Zedna Posted August 13, 2005 Share Posted August 13, 2005 code is kinda wrong. what if there are other tags between A and href.and what if they use ' instead of "<{POST_SNAPBACK}>My code is not wrong but only for one HTML page from which I download links to pictures from meteorological radar. In my application it's working fine.It was just an example for somebody to start using StringRegExp. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
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