Closed mohammad-fahs closed 2 months ago
Salam, I hope you're doing well. I encountered a problem while working on this task. I tried scraping three different websites, but when the HTML code used div elements, I didn’t get any list output. Do I need to use a different method or keyword when working with div elements, or was I doing something wrong? I also sent you this task in PDF form. Please let me know if you would prefer it by a different means. Task 2-Zeinab Khanafer.pdf
Task 2 :
Objective:
In this task, you will initialize a new Spring Boot project, add the JSoup dependency, and write a simple Java program to scrape data from a website of your choice. The goal is to get hands-on experience with setting up a Spring Boot project, using an external library (JSoup), and applying web scraping techniques.
Instructions:
com.yourname
web-scraper
Web Scraper
com.yourname.webscraper
Spring Web
dependency (to allow adding more features later).pom.xml
file in the root directory of your project.<dependencies>
tag:pom.xml
file and allow IntelliJ to update the Maven project to download the JSoup library.com.yourname.webscraper
package that implements theCommandLineRunner
interface.run
method, use JSoup to connect to the website you chose and scrape the data.Submit Your Work:
CommandLineRunner
.Resources that can help: