get data from webpage in excel

auto

Board Regular
Joined
May 20, 2012
Messages
53
hi, everyone;
i am having a code to navigate my IE browser to a webpage, and then from there i want the whole webpage to copy it into my excel sheet. can anyone help me with that?
webquery is not an answer! because i need to do some log-in and other functions till i get to that specific page that i need.
i made already all functions, but i get stuck when it comes to copy the page and paste it into excel, can anyone help me with some coding?
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
let me give some idea what i tried and i am getting an error,

'this will select all'
ie.ExecWB 17, 0
'copy'
ie.ExecWB 12, 0
ie.Quit

'this is the target where the data have to go in'

xlSheet2.Activate
Range("A1").Select
Selection.PasteSpecial xlPasteValues

error pastespecial method of range class failed

any idea what is wrong?
 
Upvote 0
ok, got it, the problem was i need to write this,

xlSheet2.PasteSpecial xlPasteValues

now its working!!
xlsheet2 was set before as a range, so i didnt have to select it.
 
Upvote 0
Just curious but why the entire page?

You could extract only the data you want from the page.
 
Upvote 0
did you have a way to select a specific place in the page and copy it using ie.ExecWB 12, 0?
if yes can you provide me the code?
really appreciated.
 
Upvote 0
Not using ExecWB, but accessing the elements of the page, eg tables, and putting the data into Excel.
 
Upvote 0
It's hard to give any code without further details.

Apart from a few things, eg opening IE and navigating to the URL, the code will be different for each page/site.
 
Upvote 0
thanks for willing to help me, i will give you the source of my page where the table i need to extract, for security reasons i need to edit the shipping info, so i set that to john smith, basically i need that table it contains shipping address.
here it is.

Code:
<table class="data-display" cellspacing="1"><tbody> <tr class="list-row"> <td class="data-display-field" width=30% valign="top"><strong>Shipping Address:</strong><br>john<br>smith<br>1111 Example St.<br>Brooklyn, NY 12090<br></td> <td class="data-display-field" width=50% valign="top"> <table class="data-display" cellspacing="0" cellpadding="0"><tbody> <tr class="list-row"></pre>
 
Last edited by a moderator:
Upvote 0
[TABLE="class: data-display"]
<tbody>[TR="class: list-row"]
[TD="class: data-display-field"][TABLE="class: data-display"]
<tbody>[TR="class: list-row"]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
k
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,248
Messages
6,171,021
Members
452,374
Latest member
keccles

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top