12-04-2007, 08:25 PM
Is possible get text of webpage without open Explorer?
Get text of webpage
|
12-04-2007, 08:25 PM
Is possible get text of webpage without open Explorer?
12-04-2007, 11:20 PM
12-05-2007, 02:24 PM
Thanks.
12-09-2007, 05:26 AM
How would I grab specific information, rather then the whole web page? For example, to just grab the "Requirements" from the QM home page.
Taking on Quick Macros one day at a time
12-09-2007, 09:37 AM
Using regular expression.
Next QM release also will have function HtmlParse that gets document object model of HTML. function $HTML [MSHTML.IHTMLDocument2&doc2] [MSHTML.IHTMLDocument3&doc3]
12-09-2007, 07:40 PM
Would findrx be better at grabbing specific information on a page compared to HtmlParse?
Taking on Quick Macros one day at a time
12-09-2007, 08:00 PM
findrx is faster, and is easy to use if you are familiar with regular expressions. Sometimes HtmlParse is more useful, especially when you want to extract text or part of text without any HTML, because it is not easy to correctly parse HTML using regular expressions. Depends on what you want to find in the page.
12-09-2007, 08:04 PM
Oh ok, which do you think would be better to use if i was trying to grab all the "High/Low" temperatures? http://www.weather.com/weather/tenday/4 ... undeclared
Taking on Quick Macros one day at a time
12-09-2007, 08:27 PM
12-09-2007, 08:42 PM
Thanks, will this only grab what is in bold print?
Taking on Quick Macros one day at a time
12-09-2007, 08:47 PM
All number degrees F
12-09-2007, 08:52 PM
Okay, any reason why when I run this it only gives me the high temperatures?
Taking on Quick Macros one day at a time
12-09-2007, 08:57 PM
12-09-2007, 09:32 PM
Great thanks. Any idea why I get this error: Error (RT) in 10 Day Forecast: array is not created. *NOTE: this macro is not done yet, just curious why i'm getting the error in one and not the other.* EDIT: Posted wrong code for first macro, corrected now. Macro ( 10 Day Forecast ) Trigger ( @11 ) str Src Src2 Message zipcode url url2 s a But in this macro I don't get the error. Macro ( Current Weather ) Trigger ( @11 ) str Src Message zipcode url
Taking on Quick Macros one day at a time
12-09-2007, 09:53 PM
findrx returns -1 when does not find.
if(findrx(...)>=0) ,code If using flag 4, returns 0 when does not find.
12-09-2007, 10:35 PM
I see, i'm just not sure how this is not finding it. Not sure what i'm doing wrong.
Taking on Quick Macros one day at a time
12-09-2007, 10:48 PM
When a regular expression does not want to work, I remove some parts of it until it begins to work, then I can see where was the mistake.
12-09-2007, 10:55 PM
Thats what I do, but now i'm not getting any error, it's just simply not working? I've changed this just to display the highs. Macro ( 10 Day Forecast2 ) str Src Src2 Message zipcode url url2 s a I get no error but it doesnt put anything into a message.
Taking on Quick Macros one day at a time
12-10-2007, 08:48 AM
Don't use tabs/commas where they should not be.
12-10-2007, 02:18 PM
Your right, okay after a little work I have it giving me a message with the weather, but it doesn't give me all 10 temperatures, I only get 1 high and 1 low, and it might actually just be the same temperature just labeld under each one. Any ideas on how to get it to show all 10 Temperatures?
Macro ( 10 Day Forecast3 ) str Src Src2 Message zipcode url url2 s a
Taking on Quick Macros one day at a time
12-10-2007, 02:56 PM
Don't know why you call IntGetFile for url2 repeatedly, and why use clipboard. My version is:
out
12-10-2007, 03:27 PM
Oh okay, not sure why I did that either, thanks for the help. One last question, is it possible to add labels for each row? such as Monday: 34 28 Tuesday: 22 18 etc.?
Taking on Quick Macros one day at a time
12-10-2007, 03:40 PM
Extract them from one of the pages using findrx, like you do with temperatures.
12-10-2007, 03:58 PM
Good idea, i'll give it a try, thanks for all the help.
Taking on Quick Macros one day at a time
12-10-2007, 04:11 PM
I hate to ask so many question, i'm just trying to learn how to do this. But how do I know what to fill in for the macro, for the dates or days? Is there a specific code for links, bold letters, or underlined statements, or is there a code I can find on the bottom of the QM screen? I've never really messed with findrx before and after reading through the QM reference im a bit confused.
Taking on Quick Macros one day at a time
12-10-2007, 04:39 PM
In web browser, right click somewhere and click 'View source' or similar menu item. It opens page source, ie HTML. Find the text you need. Usually it is surrounded by HTML tags, for example <b>bold text</b> or <a href="url">link text</a>.
In macro, use findrx to find and extract the text (eg weekday). You have to create regular expression that matches the text (possibly with html tags) you want to find. If you need multiple instances, it also must match all other instances. For example, regular expression ">(\d+)°F</B>" matches every temperature in the page. Regular expresion syntax is completely documented in QM help. Often used regular expression parts are in floating toolbar -> more tools -> reg expr menu.
12-10-2007, 05:04 PM
Ohhhhhh, that helps out alot. What do I do though if the line is different for each date? I have posted part of the line that gives the day. Each day ranges from dayNum=1-dayNum=7. A HREF="/weather/wxdetail/48183?dayNum=3"> There is also part that says Thu</B right after the dayNum. So what do I do if there is a different code for each date?
Taking on Quick Macros one day at a time
12-10-2007, 05:16 PM
Regular expressions usually are used not to find multiple instances of SAME text but rather to find multiple instances of different but SIMILAR text. For example to match a digit is used \d. To match 3-character word is used \b\w\w\w\b.
12-10-2007, 06:11 PM
Wait then how would I set it for a range from dayNum=1 to dayNum=7? I try to implement <B<A HREF="/weather/wxdetail/48183?dayNum="<B into the code and I believe because of the quotations, it is screwing up the arguments in the macro. Or maybe i'm just putting the wrong code into the macro. *NOTE - some minor parts of the code above were taken out so i could show the code.
Taking on Quick Macros one day at a time
12-10-2007, 08:14 PM
This is another way. Uses HtmlParse. You still need some parsing using findrx or other string functions, but it should be easier.
Function HtmlTableToArray ;/ |
« Next Oldest | Next Newest »
|