LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #11   Report Post  
Posted to microsoft.public.excel.programming
ron ron is offline
external usenet poster
 
Posts: 118
Default Stuck at Trying to Extract Data from a Website using JSP

On Aug 8, 8:53*pm, "Herbert Chan" wrote:
How can I make a select all on the IE page and do the copy to clipboard?

URL = "http://proptx.midland.com.hk/unit/index.jsp"
Unit = "?est_id=E00005&unit_id=U000146982"
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate2 URL & Unit

How to do the copy after the above?

Herbert

"ron" ...
On Jul 27, 9:38 am, ron wrote:





On Jul 26, 8:24 pm, "Herbert Chan" wrote...snip...


Now that a way is found, I just wonder if there is a more elegant way to
get
to the data.


HC...I agree it is not a very elegant approach. Opening IE and moving
from url to url takes time. I prefer to use the GET method whenever
possible as it does not require IE to be open. I have a macro that
checks real estate data at 800 different addresses. Using IE to move
from page to page, the maco takes 45 minutes to run; using the GET
method and parsing the source code behind each web page that is
assigned to a variable only requires 14 minutes. However when I tried
the GET method with the url I used above, the source code did not
contain the pop-up box information.


my_url = "http://proptx.midland.com.hk/unit/index.jsp?
est_id=E00005&unit_id=U000146982"
Set my_object = CreateObject("MSXML2.XMLHTTP")
my_object.Open "GET", my_url, False
my_object.send
my_var = RL.responsetext
Set my_object = Nothing


An alternative would be to still run IE, scrape the data to the
clipboard, then, rather than paste the data into a spreadsheet, the
clipboard contents can be transferred to a variable which could then
be parsed (instr, mid, left, etc.) and the desired information
extracted. I have tried this method and it works for the flats on the
web page.


Set my_object = CreateObject("htmlfile")
my_var = my_object.ParentWindow.ClipboardData.GetData("text ")


...Ron


PS...to use the clipboard transfer method the Microsoft Forms 2.0
Object Library must be selected...Ron- Hide quoted text -

- Show quoted text -


Herbert...Try the following to select the entire page and then copy to
the clipboard

ie.ExecWB OLECMDID_SELECTALL, OLECMDEXECOPT_DONTPROMPTUSER

ie.ExecWB OLECMDID_COPY, OLECMDEXECOPT_DODEFAULT

A reference to Microsoft Internet Controls must be set...Ron
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
HOW DO I ENTER DATA WHEN I SEEM TO BE STUCK IN A SUMMATION FORMULA kenneth j peterson New Users to Excel 4 January 12th 09 05:48 PM
How to extract one data from a website Lamb Chop[_2_] Excel Discussion (Misc queries) 1 June 20th 08 02:19 PM
code to extract data from a website runs of XP but not Vista Russ Excel Programming 1 May 16th 08 01:30 AM
Excel Macro - Extract data from website Icy Excel Programming 0 January 9th 08 02:39 PM
inporting data from website where website address frequently chang HP Excel Programming 3 June 24th 07 03:50 PM


All times are GMT +1. The time now is 02:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"