Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create clean/ca/los_angeles_pd.py #18

Open
gguerrei opened this issue Apr 11, 2024 · 1 comment
Open

Create clean/ca/los_angeles_pd.py #18

gguerrei opened this issue Apr 11, 2024 · 1 comment

Comments

@gguerrei
Copy link

@gguerrei
Copy link
Author

gguerrei commented May 6, 2024

MAIN VISION FOR LA:

LA has two systems for getting to the next request page:

  1. From main index page -> second index page that holds all child pages (links displayed go directly to nextrequest)
  2. From main index page -> second index page that holds most current child pages + more index pages divided by year

In both cases, all URLs come structured (displayed directly on the HTML, no need for reconstruction)

Need two distinct approaches to tackle this:

  1. For the first one, straightforward: once on the second index page, write a function that gets child pages URLs and stores them in a list. (THIS PART IS DONE)
  2. For the second one, more convoluted: will likely require running a second get_index_page_urls while at the same time running the get_child_scrape. Will need to vet which third index page URLs have already been scraped. The challenge here is understanding order of operations, and knowing where each subsequent link should be stored.

Brainstorming the second method:

Now that we understand the terms, let's move on to the plan of attack.
The scraping needs to be broken down into two parts:

PART 1: main index page scrape -> second index page scrape

from there, two possible paths:

PART 2A: child page scrape for current year
PART 2B: third index page scrape -> child page scrape

To achieve that, here are some goals:

  • Figure out how to write the conditional to run one function instead of the other (or figure out a way to make this selection manual without making the experience worse for the user + fits with other scrapers lexicon and workflow)
  • Write a checker function for future scrapes that checks if third index pages were already scraped (since they occupy previous years, no new information will be added to the pages)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant