• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

VBA code to Click on the load more button|VBA & Macros|Excel Forum|My Online Training Hub

You are here: Home / VBA code to Click on the load more button|VBA & Macros|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumVBA & MacrosVBA code to Click on the load more …
sp_PrintTopic sp_TopicIcon
VBA code to Click on the load more button
Avatar
Rajsha B
India
Member
Members
Level 0
Forum Posts: 22
Member Since:
April 7, 2020
sp_UserOfflineSmall Offline
1
April 9, 2020 - 4:59 pm
sp_Permalink sp_Print sp_EditHistory

Hi, I am editing a vba program and want macro code to click on button in a web page which is below the page. The html for the button is:

Load More WO Notes

If the button does not exists then my macro should run as is. if load button exists then it should be clicked once it loads the  data run the rest of the macro file.

My macro code is below. i want the macro inserted after the Next in the below code.

With Ws Html.body.innerHTML = ie.document.querySelectorAll(".list").Item(1).outerHTML
Set Dates = Html.querySelectorAll(".wo-notes-col-1")
Set Matters = Html.querySelectorAll(".wo-notes")
For i = 0 To Dates.Length - 1
Lr = ThisWorkbook.Sheets("Sheet2").Cells(Rows.Count, 1).End(xlUp).Row + 1
.Cells(Lr, 1) = Dates.Item(i).innerText
.Cells(Lr, 2) = Matters.Item(i).innerText
Next
End With
Thanks please ask any question if needed.
sp_AnswersTopicSeeAnswer See Answer
Avatar
Philip Treacy
Admin
Level 10
Forum Posts: 1518
Member Since:
October 5, 2010
sp_UserOfflineSmall Offline
2
April 10, 2020 - 12:55 pm
sp_Permalink sp_Print

Hi Rajsha,

It sounds like you are trying to click a button on a web page to go to the next page and get the data on that next page.

I'll need to know the page/url you are trying to get data from.  I can't write any code to interact with the website unless I can examine that page and identify a way to interact with this button.

Also, please attach your workbook with code in your reply.

Regards

Phil

Avatar
Rajsha B
India
Member
Members
Level 0
Forum Posts: 22
Member Since:
April 7, 2020
sp_UserOfflineSmall Offline
3
April 10, 2020 - 2:46 pm
sp_Permalink sp_Print

Hi Philip, 

Thanks for your reply on this query.  What you assumed in the email is exactly what i need. And my sincere apologies that i cant provide URL details due to restrictions. I understand that with out seeing the task or the way of working of the HTML code no one can guess the VBA code. Is there any other thing that i can provide in this regard. 

Regards

Rajsha

Avatar
Philip Treacy
Admin
Level 10
Forum Posts: 1518
Member Since:
October 5, 2010
sp_UserOfflineSmall Offline
4
April 10, 2020 - 3:03 pm
sp_Permalink sp_Print sp_EditHistory

Hi Rajsha,

I wrote a post on interacting with webpages which may be of help to you

Web scraping filling in forms

 

But if the website uses pagination that is controlled in the URL something like:

website.com/?page=x

then you can just load the next page by changing x and resubmitting the url.  I cover this approach here

Web scraping multiple pages

Regards

Phil

sp_AnswersTopicAnswer
Answers Post
Avatar
Rajsha B
India
Member
Members
Level 0
Forum Posts: 22
Member Since:
April 7, 2020
sp_UserOfflineSmall Offline
5
April 10, 2020 - 3:37 pm
sp_Permalink sp_Print

Hi Philip, Thanks for letting me know with the above links. I got some idea with that links. Thanks for your hard work in this.

Avatar
Philip Treacy
Admin
Level 10
Forum Posts: 1518
Member Since:
October 5, 2010
sp_UserOfflineSmall Offline
6
April 10, 2020 - 6:23 pm
sp_Permalink sp_Print

You're welcome.

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Brian Pham
Guest(s) 8
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 871
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
Jessica Stewart: 205
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
stuart burge
Bruce Tang Nian
Scot C
Othman AL MUTAIRI
Misael Gutierrez Sr.
Attif Ihsan
Kieran Fee
Murat Hasanoglu
Brett Dryland
Saeed Aldousari
Forum Stats:
Groups: 3
Forums: 24
Topics: 6223
Posts: 27295

 

Member Stats:
Guest Posters: 49
Members: 31920
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.