JonnyQuy Posted January 13, 2018 Share Posted January 13, 2018 I want to save the files in For Next, my way does not work, please help me $code = FileRead(@ScriptDir & "\lzd.html") $code1 = StringRegExp($code, '(?s)"product-description.*?\n(.*?)class\="clear">', 1) Global $codesave[3] For $i = 0 To UBound($codesave) - 1 $codesave0] = StringReplace($code1[0], "src", "data-original") $codesave[1] = StringReplace($code1[0], '<noscript><img', '<img class="productlazyimage"') $codesave[2] = StringRegExpReplace($code10], '\/><\/noscript>(.*?)original', 'src') FileWrite(@ScriptDir & "\lzd5.html", $codesave[$i]) Next Link to comment Share on other sites More sharing options...
benners Posted January 13, 2018 Share Posted January 13, 2018 Well you don't say what the error is or why it doesn't work but there is a missing square bracket here in $codesave0] $codesave0] = StringReplace($code1[0], "src", "data-original") JonnyQuy 1 Link to comment Share on other sites More sharing options...
Developers Jos Posted January 13, 2018 Developers Share Posted January 13, 2018 There is zero error checking whether the StringRegExp was successful and fail to understand what the For..Next is for. Jos JonnyQuy 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
JonnyQuy Posted January 17, 2018 Author Share Posted January 17, 2018 thank you i did it i did not understand the problem 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