Blueman

After Compile _StringBetween Error

6 posts in this topic

#1 ·  Posted (edited)

Hi All,

It took me a couple of days to figure this thing out, but i found the problem and i think this is a BUG.
But i don't know for sure, so i would like to discuss it with you guys first.

I am using the IE Embedded function to open a webpage in a GUI.
I am reading the HTML content with; _IEBodyReadHTML($oIE2)

This will Return something like; <html><div value="Test">Howdy All!</div></html>

Then i am using the function; _StringBetween()

$ReadHTML = _IEBodyReadHTML($oIE2)
$FoundArray = _StringBetween($ReadHTML, '<div value="Test">', '</div>')

When i run the script with sciTE, it is working fine!

But when i compile the script, and then activate the .exe The _StringBetween function doesn't find anything,...
But wait, when i delete the "" it is working again,.. (after compile),..
 

$ReadHTML = _IEBodyReadHTML($oIE2)
$FoundArray = _StringBetween($ReadHTML, '<div value=Test>', '</div>')

 

Possibly this is a error within the _StringBetween function, or it is a error within the _IEBodyReadHTML() Function.

 

Anyone has an idea?

 

Thanks Guys!

 

EXTRA: AUTOIT Version; 3.3.12.0 / SCITE 3.4.4

Edited by Blueman
Version number

Share this post


Link to post
Share on other sites



#2 ·  Posted

4 minutes ago, Blueman said:

But when i compile the script, and then activate the .exe The _StringBetween function doesn't find anything,...
But wait, when i delete the "" it is working again,.. (after compile),..

Doubt this is an issue with AutoIt but rather the string received. Do some debugging in your script like writing data to a log file to ensure what is received.
Running it from SciTE or compile is basically the same code ran with the same stub so doubt your BUG suggestion is valid, other than possibly in your script.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#3 ·  Posted

Hi Jos,

I did some debugging and found out that the string received doesn't have the "" Quotes after compile.
It does however have the "" Quotes Before the Compile,...

Does _IEBodyReadHTML()  read the HTML in a different way before and after compile?

Thanks!

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Strange thing then,..

No i don't have multiple versions of IE.au3
The version that i have;

    Version:  T3.0-1
    Last Update: 13/06/02

 

--- EDIT ---

Well, i have tried a dozen things but it isn't working.
I have however found out why the problem is occurring,..

This is the Explanation from _IEDocReadHTML()

Remarks

This function returns the document source after any client-side modifications (e.g. by AutoIt or by client-side JavaScript).
It may therefore be different than what is shown by the browser 


So AutoIt is changing the output and then it isn't working anymore,..
And that is correct because the output should contain; value="Test" But it is containing; value=Test
The second thing is that all the HTML tags are CAPITAL, so AutoIt is changing a lot of things,... i don't know why,. but OK that is the problem.

Now the solution.

I would like to use RegEXP in combination with the _StringBetween function.
Is this possible?

I have tried the following, but it isn't working like it should;

 

$TestOutput = _StringBetween($ReadHTML, '<div value=["|]Test["|]>', "</div>")

 

Thanks Guys!

Edited by Blueman

Share this post


Link to post
Share on other sites

#6 ·  Posted

Well This is Hopeless,..
I have changed the search string to something else other then value="Something",.. 
It is not a very good workaround but it is working,..

Also i have noticed that this is only happening at HTTPS websites, HTTP websites are fine,.

Very Strange, but thanks for the help so far!

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now