In this article we will learn how to scrape data from X.com (Twitter) using WebHarvy. WebHarvy is an easy to use and intuitive web scraping software that allows you to scrape data from any website without writing any code. It has a point-and-click interface that makes it easy to select the data you want to scrape.
Scraping Multiple X / Twitter Profile Data
The video shown below demonstrates how WebHarvy can be used to scrape data from profiles of multiple X.com users (Twitter Profiles). As shown in the video, each profile page at X displays the posts (tweets) made by the user, along with details like the date of posting, number of likes, retweets, etc. WebHarvy can be configured to scrape these details from multiple profiles in a single run.
Since X (Twitter) uses infinite scroll pagination to load more posts as the user scrolls down, WebHarvy can be configured to handle this type of pagination. This means that you can scrape all the posts from a profile without having to manually scroll down the page.
The JavaScript pagination method is used to automatically scroll down the page and scrape posts from multiple pages. The code used for pagination is given below
list = document.querySelector('h1[role="heading"][aria-level="1"]').nextElementSibling.children[0];
list.children[list.childElementCount-1].scrollIntoView();
Steps to follow to Scrape X (Twitter) using WebHarvy
- 1. Download and install WebHarvy in your computer
- 2. Load the Twitter/X profile page from which you need to scrape data, within WebHarvy's configuration browser
- 3. Start Configuration
- 4. You can now click and select the data which you need. Details like post/tweet content, author name, handle, date etc. can be selected in this way.
- 5. Clicking on any data item on the page will display a Capture window with various options. Select the 'Capture Text' option to scrape the text of the clicked item
- 6. Use the 'Capture Target URL' option to scrape the URL of the item
- 7. Configure pagination using the code given above.
- 8. Stop Configuration
- 9. You can now optionally save the configuration, so that it can be run, edited or scheduled later.
- 10. Start Mine
Download WebHarvy Free Trial
We recommend that you
download
and try using the free evaluation version of WebHarvy.
Getting Started Guide.
Questions?
Contact our customer support in case you need assistance in configuring WebHarvy.