ASU-CodeDevils / scraper.codedevils.org

A system for scraping job postings from various websites and serving the collected data through an API.
https://codedevils.org
MIT License
0 stars 1 forks source link

Create handle-search.java #4

Open PitaFLAME opened 1 week ago

PitaFLAME commented 1 week ago

We need a file to handle searching a given page for a given search criteria, and returning links.

Please accomplish the following:

100 points

Cartier32 commented 1 week ago

Going to take some time with this issue to try and get used to Selenium/guide me on what I need to learn. Will be keeping updated.

Cartier32 commented 1 week ago

After working with the issue for a couple hours I have a couple of questions.

What can I do to test my current iteration? When you say main function do you mean "public static void main" or a different "main" function? Is the handle-search file only supposed to contain selenium logic or also springboot annotations? How do I return an array list from this file?

I have a grasp on the core selenium logic and how to use WebDriver but I am struggling to understand how the system interacts.

PitaFLAME commented 1 week ago

Hey, so forgive me, I'm actually used to PlaywrightJS more than I am with Selenium, so if some of the requirements I put in here don't make complete sense, that's 100% on me. (I'm only subbing in for Frankie rn lol)

  1. Reach out to me on Discord. I can give you the test account I made for testing this application. If you're asking about setting up a dev environment, I'm afraid I'm a little less helpful there, but I can get you some resources if you'd like.
  2. I did just mean the primary function that's called from the module. It probably shouldn't be named Main. It should actually match the name of the file it's in. So, given that, I will ammend the requirements of the naming convention. Instead of using lisp-case 'like-this.java', use camelCase 'likeThis.java' and have your primary function inside that file match the name of the file.
  3. You'll have to forgive me for this one, I've never worked with Springboot. However, to my understanding, we shouldn't need anything to do with SpringBoot because this is not the file being called by an API call. This file/function will be called directly by another file in #3. This file is meant to only handle searching a single criteria on a single page, and scraping what it finds. We're actually going to be adding quite a bit onto this one, but we wanted some basic functionality to it first.
  4. I'm not sure if I'm missing something with this question. ArrayLists in Java, to my knowledge, are not global; they're just objects, and should be able to be passed with a return statement, right? The reason I chose an ArrayList is because we don't know how many jobs we're going to find on any given page, and I thought a flexible data type would be convenient. However, if you want to store them in an ArrayList while scraping, then package the ArrayList into an Array with exact SIZE before shipping it back to the program, you're welcome to do that, and I'll allow it.