Here is what I have so far:
public List<JobPosting> getJobPostings(String searchString)
{
List<JobPosting> list = new ArrayList<>();
int startValue = 0;
Elements jobSearchResultItems;
do
{
Document document = getDocument(searchString, startValue);
jobSearchResultItems = document.select(".job-search-result-item");
for (Element element : jobSearchResultItems)
{
JobPosting jobPosting = new JobPosting();
jobPosting.setTitle("element.???");
list.add(jobPosting);
}
start += 25;
} while (jobSearchResultItems.size() == 25); //if not 25, then there are no more pages after this
return list;
}
What I am stuck on is, once I identify the elements with the class "job-search-result-item", how do I then identify the part of each element that is the job title, city, etc? Don't I also need to know the classes of the elements that contain those values?