Home |
Search |
Today's Posts |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
HOW DO I ENTER DATA WHEN I SEEM TO BE STUCK IN A SUMMATION FORMULA | New Users to Excel | |||
How to extract one data from a website | Excel Discussion (Misc queries) | |||
code to extract data from a website runs of XP but not Vista | Excel Programming | |||
Excel Macro - Extract data from website | Excel Programming | |||
inporting data from website where website address frequently chang | Excel Programming |