Ned Posted September 14, 2011 Posted September 14, 2011 (edited) Why will this not work? I have spent a few hours on this one little problem. I have tried everything I can think of to make it work, but never wants too. I have tested the pattern in a few other scripts and it works fine. the @ERROR says it is a bad string - but how can String($HTML) be bad? Is it to much text for it to string? $IE = _IECreate("C:\Users\Ned\Dropbox\Public\Findings.html", "", 0) $HTML = _IEBodyReadHTML($IE) _IEQuit($IE) $HTML = String($HTML) $array = StringRegExp($HTML, '(?<=\QNew: <a href="/items/view/\E)(.*?)(?=\Q">\E)', 3) ;gets new item numbers _ArrayDisplay($array) Edited September 14, 2011 by Ned
Beege Posted September 14, 2011 Posted September 14, 2011 I dont see any error checking. How do you know its coming from String()? Have you tried printing $HTML to the console to verify that _IEBodyReadHTML() worked? Assembly Code: fasmg . fasm . BmpSearch . Au3 Syntax Highlighter . Bounce Multithreading Example . IDispatchASMUDFs: Explorer Frame . ITaskBarList . Scrolling Line Graph . Tray Icon Bar Graph . Explorer Listview . Wiimote . WinSnap . Flicker Free Labels . iTunesPrograms: Ftp Explorer . Snipster . Network Meter . Resistance Calculator
Ned Posted September 15, 2011 Author Posted September 15, 2011 I have made string $html print to console and everything was there like it should. The pattern works fine when I put the raw text in the script directly, just never when it gets it from an ie window.
Beege Posted September 15, 2011 Posted September 15, 2011 Wait...If you manually add the string $html to your script it works? That is weird. I have a few ideas that might work, but nothing to figure out whats actually going wrong. Maybe try putting on the clipboard and then reading back? Clipput($html) $html = clipget() If that doesnt work maybe Clipput($html) $html = clipget() _filecreate(@scriptdir & '\Temphtml.txt') filewrite(@scriptdir & '\Temphtml.txt', $html) $html = fileread(@scriptdir & '\Temphtml.txt') filedelete(@scriptdir & '\Temphtml.txt') Assembly Code: fasmg . fasm . BmpSearch . Au3 Syntax Highlighter . Bounce Multithreading Example . IDispatchASMUDFs: Explorer Frame . ITaskBarList . Scrolling Line Graph . Tray Icon Bar Graph . Explorer Listview . Wiimote . WinSnap . Flicker Free Labels . iTunesPrograms: Ftp Explorer . Snipster . Network Meter . Resistance Calculator
Ned Posted September 15, 2011 Author Posted September 15, 2011 I ended up going a different route using table to array function since it wasn't working. Luckily I am able to use that function. Never tried the other options you gave in last post, but thanks for the help.
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