malreinschaun Posted July 11, 2019 Share Posted July 11, 2019 Hi Auto-It Community, I have a small challenge. Html-Code <form action="dosomething" method="post" name="doit"> <input type="hidden" value="hm" name="ct"> <input type="hidden" value="u" name="id"> <input class="" type="submit" value="Jetzt testen" name="Submit"> </form> I would like to get the "u" of the value. My approach was $htmltext = _FFReadHtml() $IwantThatId=_StringBetween($htmltext,'name="id" value="','">') ;Msgbox(64,"showMetheID",$IwantThatId) Unfortunately I do not get anything back. What other options to I have? From what I saw I am lucky that this line only appears once. Your help is much appreciated. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 11, 2019 Developers Share Posted July 11, 2019 3 minutes ago, malreinschaun said: 'name="id" value="' Where do you see this string in the input? Jos 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...
malreinschaun Posted July 11, 2019 Author Share Posted July 11, 2019 sorry, the correct code is $htmltext = _FFReadHtml() $IwantThatId=_StringBetween($htmltext,'name="hm" value="','">') ;Msgbox(64,"showMetheID",$IwantThatId) Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted July 11, 2019 Share Posted July 11, 2019 @malreinschaun Pay more attention at what you are doing, since you keep changing the script. How could you retrieve something between A and B when you are trying to retrieve something form B and A? Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Danp2 Posted July 11, 2019 Share Posted July 11, 2019 @malreinschaun Have you considered upgrading to the Webdriver UDF (see my sig) so that you are stuck using an outdated version of FF? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
malreinschaun Posted July 11, 2019 Author Share Posted July 11, 2019 @FrancescoDiMuro thanks for the input, still I do not know what you want to point out. @Danp2 thanks for the input - Currently I am just looking for a way to get that character. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 11, 2019 Developers Share Posted July 11, 2019 1 hour ago, malreinschaun said: sorry, the correct code is $htmltext = _FFReadHtml() $IwantThatId=_StringBetween($htmltext,'name="hm" value="','">') ;Msgbox(64,"showMetheID",$IwantThatId) Doubt that : Where is 'name="hm" value="' located in your text? So my point really is: Stop the messing about and post your script you are testing with and please have a close look first yourself! Jos 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...
Developers Jos Posted July 11, 2019 Developers Share Posted July 11, 2019 1 hour ago, malreinschaun said: sorry, the correct code is $htmltext = _FFReadHtml() $IwantThatId=_StringBetween($htmltext,'name="hm" value="','">') ;Msgbox(64,"showMetheID",$IwantThatId) Doubt that : Where is 'name="hm" value="' located in your text? So my point really is: Stop the messing about and post your script you are testing with and please have a close look first yourself! Jos 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...
malreinschaun Posted July 11, 2019 Author Share Posted July 11, 2019 I am so sorry for mixing it up, now I saw my mistake. Here is the corrected example <form action="dosomething" method="post" name="doit"> <input type="hidden" name="id" value="b"> </form> I would like to get the "b" of the value. My approach was $htmltext = _FFReadHtml() $IwantThatId=_StringBetween($htmltext,'name="id" value="','">') ;Msgbox(64,"showMetheID",$IwantThatId) Link to comment Share on other sites More sharing options...
Developers Jos Posted July 11, 2019 Developers Share Posted July 11, 2019 mmm.. so you really don't want to share what you are really doing and simply fix up some code to share with us. ....right. Either way ... the last posted code works fine when you display the first instance of the returned array. The Helpfile is your friend! Jos 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...
malreinschaun Posted July 11, 2019 Author Share Posted July 11, 2019 Thanks for your reply, I have already tried to use the following code without success. Msgbox(64,"showMetheID",$IwantThatId[0]) Link to comment Share on other sites More sharing options...
Developers Jos Posted July 11, 2019 Developers Share Posted July 11, 2019 Works fine here: #include <String.au3> $htmltext='<form action="dosomething" method="post" name="doit"><input type="hidden" name="id" value="b"></form>' $IwantThatId=_StringBetween($htmltext,'name="id" value="','">') ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $IwantThatId[0] = ' & $IwantThatId[0] & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console Jos 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...
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