Home > Forum Home > Automating Data Analysis Tasks > Automating a web query login to download data | Share |
Forum Topic | Post Reply Login |
Automating A Web Query Login To Download Data | Rate this: (2.8/5 from 16 votes) |
I have a funamental earnings and valuation model spreadsheet that downloads stock data from a number of different websites via certain add-ins. One of the sites that it gets information from is investors.com, which requires a login before downloading stock information (not just price/volume/etc data, I get that easily from Yahoo). Problem is that you have to manually login through a web query each time, and this is the current instructions:
Thanks in advance for any help you can provide! | ||
Posted by kilo94 on |
Replies - Displaying 11 to 20 of 40 | Order Replies By: Most Recent | Chronological | Highest Rated |
Rate this: (3/5 from 1 vote) https://my.secure.home1.ul.com/portal/page/portal/usa/Tools/MyProjects/Open%20Projects Have no clue what I need to do . I need to import data from this website, but the first step is how can I log in with excel. Please help. | |
Posted by Nick1234 on |
Rate this: (3/5 from 1 vote) I get "a" and "b" for variables for username and pw respectively. from [http://www.bentekenergy.com/Benport/Login.aspx?ReturnUrl=/Benport/DisplayReportNews.aspx%3fLOC%3d1%26ID%3d0%26doc%3dBENTEK_EMF_NukeOutages.pdf&LOC=1&ID=0&doc=BENTEK_EMF_NukeOutages.pdf] I get "Login1$UserName" and "Login1$Password" for variables for username and pw respectively. Neither of those seem to work once. I also tried changing url from Login.aspx to BENportTech.aspx with no luck...... What else could I try to make this work...? I very much appreciate the help! | |
Posted by vzny254 on |
Rate this: (3/5 from 1 vote) Try to use the VBA code at the beginning of this thread to login to the web site that you need the content for in Excel. For vzny254: On further investigation I think that Login.aspx is the correct target page and the other page is simply a redirect on the login event. I think that the issue is that it is a .NET page which requires a valid session variable (you will see this in the HTML source). Therefore you need to first get the session variable from the login page and send it back when you log in. It is possible to do this using the XML object in VBA. This is a bit tricky as it will return the HTML source of the page and then you will then need to get the right attribute value to extract the session variable from that. To use the XML object the code will resemble as follows: VBA Code:
| ||
Excel Business Forums Administrator | ||
Posted by Excel Helper on |
Rate this: (3/5 from 1 vote) It shows me an error when I run it, it says: Websit "http:......... cannot be opened and data cannot be downloaded" What do you think might be wrong? Thanks for your help | |
Posted by Nick1234 on |
Rate this: (3/5 from 1 vote) | |
Posted by vzny254 on |
Rate this: (3/5 from 1 vote) | |
Excel Business Forums Administrator | |
Posted by Excel Helper on |
Rate this: (3/5 from 1 vote) VBA Code:
I have created a new post with this solution here as I think that it is useful on its own. | ||
Excel Business Forums Administrator | ||
Posted by Excel Helper on |
Rate this: (3/5 from 1 vote) | |
Posted by vzny254 on |
Rate this: (3/5 from 1 vote) | |
Excel Business Forums Administrator | |
Posted by Excel Helper on |
Rate this: (3/5 from 1 vote) tempStr = Mid(x, StartPos, Len(x) - StartPos) | |
Posted by vzny254 on |
Back | Displaying page 2 of 5 | Next |
Find relevant Excel templates and add-ins for Automating a web query login to download data in the Excel Business Solutions Directory |