Jump to content

Basic IE.udf use


Newb
 Share

Recommended Posts

Can you post the last code you tried? I will see what can I do. Concerning http udfs I find this one particularly useful and well documented as well:

...And I think nobody is laughing at you. You are probably skipping something important but believe me you're doing better than me at the beginning. Just take it easy :x

No problem, if you read the previous post you will see that it's just my windows installation that was fu**ed up very well. I created a new windows account and now I've gone ahead, my code was working wonderful. Thanks for ur support. I would like to ask more...

Since I opended this thread to ask about IE.au3, I will keep asking things here, so anyone who comes in touch with this will have more info in one thread instead of looking for others.

My question is: Is it possible to read data from a page not opened?

I mean this:

As I told you I have a website which is embedded in the autoit GUI, now I can read text and all when the page is displayed in the gui. How i can read values, text or so when i'm browsing another page?

I need this to keep a summary of all the statistic of the site in the gui.

Example

site is Index.html, in the Index page it's displayed:

Visitors to your site: 4033

People who liked your site 2300

then in the Index page there is a link to: MoreStatistics.php

and in the morestatistic page there is:

People who disliked it: 393 mostly from Russia

People who didn't voted:1000

And in the Index page there is another link to: FinalStats.Html

And in finalstats page there is:

People from america who visited: 2003

Members who joined the site: 1040

Number of pages in the site: 3

And so on. How i fetch those values remaining in the index.html to report them all?

I would like to set them into the Gui with GuiCtrlSetData once collected, but not visiting all the 3 pages.

Only thing i can think of is InetGet which I never usedm to download the page and read it from hard drive, but that would be a bit cumbersome.... no other idea? Like a hidden attaching to ie windows or anything?

Edited by Newb

I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it.

Link to comment
Share on other sites

No problem, if you read the previous post you will see that it's just my windows installation that was fu**ed up very well. I created a new windows account and now I've gone ahead, my code was working wonderful.

Oh great!. I remember that I experimented something similar with _IECreate, Sometimes an error prompt appeared when creating the explorer object but in another machine with a clean installation of internet explorer It went smoothly and I never experimented that error. Keep in mind that when working with things like excel, ie or windows you can get errors from those applications which the script is not to blame for.

Concerning your question of getting data in webpages. If you use IE.au3 you have to navigate to each page to get its source code (and then use IEBodyReadHTML for instance), there's no other way to do it. Another way would be to use as you said INetGet or as I prefer Anyway you would need to 'GET' the source code of each page you want to extract data from. The advantage of WinHTTP is that you don't have to wait to load the page in a browser, you just get a string with the source code which is faster, also you don't have to worry about redirections,pop-ups etc.

The advantage of using IE.au3 is that you can use objects references ,for instance to click a link you can use _IELinkClickbyName and then get a reference to the DIV object where the data you want to extract is. If you use WinHTTP.au3 you will need to use StringInStr or better, regular expressions (StringRegExp) to parse the data you want. It's not that difficult though.

Link to comment
Share on other sites

Oh great!. I remember that I experimented something similar with _IECreate, Sometimes an error prompt appeared when creating the explorer object but in another machine with a clean installation of internet explorer It went smoothly and I never experimented that error. Keep in mind that when working with things like excel, ie or windows you can get errors from those applications which the script is not to blame for.

Concerning your question of getting data in webpages. If you use IE.au3 you have to navigate to each page to get its source code (and then use IEBodyReadHTML for instance), there's no other way to do it. Another way would be to use as you said INetGet or as I prefer Anyway you would need to 'GET' the source code of each page you want to extract data from. The advantage of WinHTTP is that you don't have to wait to load the page in a browser, you just get a string with the source code which is faster, also you don't have to worry about redirections,pop-ups etc.

The advantage of using IE.au3 is that you can use objects references ,for instance to click a link you can use _IELinkClickbyName and then get a reference to the DIV object where the data you want to extract is. If you use WinHTTP.au3 you will need to use StringInStr or better, regular expressions (StringRegExp) to parse the data you want. It's not that difficult though.

Uhm, every new project I do reveals as a full learning course. :x

Making this thing I had to learn IE.au3, string management, some gui dialogues new things, and now WinHttp.au3.

ahah, love it :P

Well, I'll try to check for http.au3 script and examples and see what I can get out of it. Meanwhile, could you address me to some winhttp examples or scripts?

I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it.

Link to comment
Share on other sites

Uhm, every new project I do reveals as a full learning course. :x

Making this thing I had to learn IE.au3, string management, some gui dialogues new things, and now WinHttp.au3.

ahah, love it :shifty:

Well, I'll try to check for http.au3 script and examples and see what I can get out of it. Meanwhile, could you address me to some winhttp examples or scripts?

I advice you to use (you can download the UDF in the first page of the thread) since it seems to be more up to date than http.au3 (and also because it is the one which I have been using cause Wakillon suggested that :nuke: )

In the WinHttp thread I linked before you'll find plenty of examples in the chm included in the zip of WinHttp. You can also see the developer versions here

You can also check some of my threads were I asked about WinHttp: http://www.autoitscript.com/forum/index.php?app=core&module=search&do=user_activity&mid=50235

Concerning the learning part, I think that after you learn the basics of programming, you have to continue learning libraries and functions and practising, practising, practising. It's like when you learn a foreign language, in my case English (and also French but its grammar is more similar to Spanish than English is): First you learn the basics of the language (present simple, present continuous) and even after you have a proficiency level (past perfect continuous, second, third conditionals, discursive essays, phrasal (multi part) verbs :P and many more) you have to learn slang (what's up dude?, heya, I'm gonna do sth, I wanna eat sth) which the best way is by staying in a foreign country (or being active in a forum :( but that has the collateral effect of ruinning your spelling and grammar skills :lol: ) . In the same way language evolves all the time, libraries and classes created by programmers are being continuously created and in order to make new things (and obviously in the case you need to use them) you should keep up to date with them.

Edited by Mithrandir
Link to comment
Share on other sites

I advice you to use (you can download the UDF in the first page of the thread) since it seems to be more up to date than http.au3 (and also because it is the one which I have been using cause Wakillon suggested that :shifty: )

In the WinHttp thread I linked before you'll find plenty of examples in the chm included in the zip of WinHttp. You can also see the developer versions here

You can also check some of my threads were I asked about WinHttp: http://www.autoitscript.com/forum/index.php?app=core&module=search&do=user_activity&mid=50235

Concerning the learning part, I think that after you learn the basics of programming, you have to continue learning libraries and functions and practising, practising, practising. It's like when you learn a foreign language, in my case English (and also French but its grammar is more similar to Spanish than English is): First you learn the basics of the language (present simple, present continuous) and even after you have a proficiency level (past perfect continuous, second, third conditionals, discursive essays, phrasal (multi part) verbs :x and many more) you have to learn slang (what's up dude?, heya, I'm gonna do sth, I wanna eat sth) which the best way is by staying in a foreign country (or being active in a forum :lol: but that has the collateral effect of ruinning your spelling and grammar skills :nuke: ) . In the same way language evolves all the time, libraries and classes created by programmers are being continuously created and in order to make new things (and obviously in the case you need to use them) you should keep up to date with them.

Well since I'm Italian and i speak other 3 languages (French, English and Spanish), in the way you told it, it should be easy to learn it :P

Anyway, I've noticed that today programming is much harder and requires knowledge in certain number of fields greater than it was some years ago.

Well, to stop off topic, I will got to check how to grab a page source without opening it.

Edited by Newb

I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it.

Link to comment
Share on other sites

At the cost of making it less professional, i though another way, just need advices on it.

Since Http requires lot of background theory, to keep my project going i thought of this:

Making another invisible/hidden/out of the GUI control with another webpage embedded in it. In that second control, I would load all the pages of which I need the source, while the main page where user can browse manually if he wants stays there available to the user.

My particular idea for this was that while in the main control the user can read the mails, in the other gui other pages like the new mail lists, list of contacts and so on are loaded and strings or ID of controls there are fetched and go feed the gui which gets filled with the infos.

Or, if you mind, i would like to see a practical example of how i can do it with WinHttp, because im reading a long tutorial on HTTP (though i had some previous knowledges), and other than taking some time to fully understand it, it seems it will be a cumbersome work.

So I would like to have an opinion and advices on how to hide that gui in the main gui (I don't know, like putting it invisible with some style, like putting it in a second invisible gui behind the main one or whatever you can think of) and if you could, show me a a script using WinHttp that can fetch pages which aren't loaded, or, also get text or whatever from them.

Thanks in advance

I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it.

Link to comment
Share on other sites

I don't know what you want to do but if you want to get information from a site (mails, contacts and such) I think the best option is using WinHttp.au3 . That way you won't have to deal with hiding GUIs. You have plenty of examples in WinHttp.chm helpfile. On the other hand, if you're more used to IE.au3 maybe you prefer using it. I think you have two problems that you should differentiate:

1)The GUI part of the project (if you use WinHttp.au3 this part would be easier cause you won't have to deal with embedding ie explorers in the GUI).

2) Using IE.au3 or WinHttp.au3 to fetch the data. (From what I read you're more used to IE.au3 but using it may complicate part 1)

You have to strike the balance between these two options which a priori may be difficult so I suggest you to start working in part 2) and make the application GUI-less but make it modularized i.e with functions, so that afterwards you can use these functions in your GUI.

Either way, take some action and show us some code so that we can assist you! :x

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...