In this blog, we will show you how to scrape medical journals and research papers from PubMed with our free web scraper, ParseHub, in just a few steps!
You can also check out our guide on web scraping Google Scholar.
Whether you need to scrape journals and papers for research, or for citations, this guide will help you gather large amounts of references, abstracts and articles from PubMed. PubMed was released in 1996, and is over 27 years old! It has been used ever since as a free search engine for life science and bio-med research papers. PubMed has over 30 million records, 7.5 million of which are available for free.
Ready to scrape scholarly journals and papers? Let’s get started!
Step 1: Scraping Articles
- Firstly, open the ParseHub application and log in.
- On the front page, click “New Project” to start a new project.
- Enter the PubMed URL you would like to scrape from, we will use this URL to scrape articles containing the term ‘web scraping’: https://pubmed.ncbi.nlm.nih.gov/?term=web+scraping
- Once the page fully loads, click the first article’s name to extract it, it should be an A tag.
- The rest of the article titles should turn yellow, click the next one to train the algorithm.
- All 10 article titles should now be extracted from the first page, rename this selection to “article” on the left pane.
Step 2: Scraping Additional Information
Now that we have each article title, let’s scrape their authors, summaries and ids:
- Firstly, click the PLUS(+) button on the “article” selection you just made.
- Choose “Relative Select” and click the first article’s title again.
- Move the arrow to the respective article’s author(s) and click to close the arrow.
- All 10 article authors will now be extracted, rename this selection to the left to “author”.
- Now do another “Relative Select” again by clicking the PLUS(+) button next to your “article” selection from the first step.
- Click the first article’s title and this time close the arrow on its summary.
- Rename this extraction on the left to “info”.
- Finally, redo the “Relative Select” step again and this time click the title and then the PubMed ID.
- Rename this selection on the left to “PMID”.
Step 3: Pagination
If we begin the script now, we will only scrape a single page. To scrape multiple or all pages, we need to use ParseHub’s pagination.
- Begin by scrolling down the PubMed page until you see the next page navigation bar.
- Click the PLUS(+) button next to your “page” selection and choose “Select”.
- Click the next button on the navigation bar to select it.
- Rename this selection to “pagination”, expand it, and delete the extraction.
- Click the PLUS(+) button next to your “pagination” selection and choose “Click”.
- Choose “Yes” on the popup, as this is a next-page button.
- Enter the number of additional pages you wish to scrape, we chose 2, which is 3 pages of scraped data in total. Entering 0 will scrape every single page available!
Step 4: Start PubMed Scraping
Awesome, just one step left, and that is to begin scraping on ParseHub’s servers!
To begin scraping, click the green “Get Data” button on the left-hand side of ParseHub. You can test, run or schedule your scrape. We chose “Run” to scrape a single time, which resulted in 3 pages of scraped data. (as specified in the pagination step)
If you followed our tutorial, your data should look like this:
If you need help scraping scientific journals, articles or any other publication, you can contact our live support.
Happy Scraping! 💻