scrape-it | 🔮 A Nodejs scraper for humans | Scraper library
kandi X-RAY | scrape-it Summary
kandi X-RAY | scrape-it Summary
🔮 A Node.js scraper for humans.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Scrape HTML
scrape-it Key Features
scrape-it Examples and Code Snippets
def fetch_pharmacy_and_price_list(drug_name: str, zip_code: str) -> list | None:
"""[summary]
This function will take input of drug name and zipcode,
then request to the BASE_URL site.
Get the page data and scrape it to the genera
Community Discussions
Trending Discussions on scrape-it
QUESTION
On my express server I have a script which retrieves items through scraping. I want to trigger this script once in a while and push the retrieved items into my database.
My first ideas was to create an endpoint in my API (e.g. /api/scrape-items). The problem is that it would be a GET request responsible for running the script, retrieving the items AND PATCH the items (update) my database. It doesn't seem right to let a GET request do all of that, especially to make a PATCH request, but I can't change the GET request to a POST request either because I have no body.
Can someone help me come up with a better approach? Thanks!
UPDATE: Example of triggering endpoint:
...ANSWER
Answered 2020-Jan-06 at 21:09A POST request is perfectly acceptable for uploading content to a database. PATCH is usually reserved for when you are partially updating and item. So if you are just updating stuff in your database with this request, then don't hesitate to use PATCH. If you are completely replacing the resource in the database though (or you require the entire resource in the HTTP request, not just the modified stuff), then I'd recommend using PUT instead.
A GET request would be acceptable as well in this situation if you were returning data to the user.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install scrape-it
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page