+ Reply to Thread
Results 1 to 5 of 5

Complete multiple web forms and extract data with vbA - object not defined

  1. #1
    Registered User
    Join Date
    09-26-2012
    Location
    for mnitiesq
    MS-Off Ver
    Excel 2010
    Posts
    3

    Complete multiple web forms and extract data with vbA - object not defined

    I want to use VBA to execute the following steps:

    - user enters a keyword in cell B1 (defined as keyword)
    -that triggers the keyword to be entered at http://www.ubersuggest.org and the "suggest" button is pressed to submit
    - VBA then presses "select all" then "get" then exports the data to column C
    - the user is logged into google adwords https://adwords.google.com/o/Targeti...=KEYWORD_IDEAS (to avoid entering the captcha)
    - the data from ubersuggest is entered in the form after the user is logged in
    - the "exact" check box is checked on the left under match types and "broad" is unchecked
    -the "search" button is pressed
    - the data is exported by clicking "save all", then the "download" dropdown, then "my keyword ideas" and then "download"

    I am having a lot of trouble since I'm still learning a lot about VBA. This is my code so far (which isn't working):
    keyword analysis.xlsm

    Please Login or Register  to view this content.
    I have also attached the workbook. Any help pointing me in the right direction would be great. I'm having a hard time finding what the form variables are named for both ubersuggest and google.

    Thanks for your time.

  2. #2
    Registered User
    Join Date
    09-26-2012
    Location
    for mnitiesq
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Complete multiple web forms and extract data with vbA - object not defined

    bump-noreply

  3. #3
    Valued Forum Contributor
    Join Date
    05-21-2009
    Location
    Great Britain
    MS-Off Ver
    Excel 2003
    Posts
    550

    Re: Complete multiple web forms and extract data with vbA - object not defined

    A few tips:

    1. Don't use Worksheet_Change whilst developing the code, as it requires you to enter data on the worksheet to trigger the code and you will need to flick between the worksheet and the VB editor. Just use a subroutine with a hard-coded keyword in a standard module and stay within the VB editor.

    2. Don't use late binding (Dim ie As Object, Set ie = CreateObject..) whilst developing the code. Instead use early binding (Dim IE As Internet Explorer, Set IE = New Internet Explorer) for which you must set a reference to MS Internet Controls in Tools - References in the VB editor. Also set a reference to MS HTML Object Library for the IE.document object and its properties and methods.

    3. For web page form names etc. use View Source in your browser.

    For ubersuggest.org, there is an easier way than populating/clicking the form elements. Enter the search term and click 'Suggest', and at the bottom of the page there is a "Link to this query" hyperlink. For example, I searched for "Excel VBA training" and the link is http://ubersuggest.org/?query=Excel+...USA&source=web. This means you can query the search term directly without populating the form. Furthermore, we can use XMLhttp instead of IE to get all the suggestions, like this:

    Please Login or Register  to view this content.
    The XMLhttp object requires a reference to MS XML v6.0. Note that the spaces in "Excel VBA training" are replaced by + signs and / is replaced by %2F to encode the query string. You could use one of the functions at http://stackoverflow.com/questions/2...g-in-excel-vba to encode the query string.

    I haven't looked at the Google Adwords part, but hopefully the above should give you some ideas.
    Post responsibly. Search for excelforum.com

  4. #4
    Registered User
    Join Date
    09-26-2012
    Location
    for mnitiesq
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Complete multiple web forms and extract data with vbA - object not defined

    Thanks that helps a lot. Really appreciate it. I don't see any sort of link to query option for Google Adwords though so how would you recommend entering and extracting that data?

  5. #5
    Valued Forum Contributor
    Join Date
    05-21-2009
    Location
    Great Britain
    MS-Off Ver
    Excel 2003
    Posts
    550

    Re: Complete multiple web forms and extract data with vbA - object not defined

    Quote Originally Posted by excelseo View Post
    I don't see any sort of link to query option for Google Adwords though so how would you recommend entering and extracting that data?
    Nope, web pages aren't usually that helpful or easy to extract data from. For Adwords I think you'll need to use IE automation - good luck!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1