Comments (2)
I recommend separating it in 2 functions as follows:
from botasaurus import *
from flask import Flask, jsonify, request
from scraper.yp_usa_scraper import *
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
@request(use_stealth=True)
def scrape_heading_task(request: AntiDetectRequests, data):
data = request.get_json()
response = request.get('https://www.yell.com/ucs/UcsSearchAction.do?scrambleSeed=1475848896&keywords=hairdressers&location=hatfield%2C+hertfordshire')
return response.text
@app.route('/scrape/yp-usa', methods=["POST"])
def scrape_yp(request):
data = request.get_json()
return scrape_heading_task(data )
if __name__ == "__main__":
# Run the Flask development server
app.run(debug=True)
from botasaurus.
thank you :)
from botasaurus.
Related Issues (20)
- Unable to pass steamdb detection HOT 1
- Unable to scrape G2.com HOT 1
- headless=False in is_docker() mode HOT 1
- Can we have more details on the documentation HOT 2
- Botasaurus perfomance HOT 1
- Dockerfile HOT 4
- Request, Stealth Mode not working HOT 1
- Browser Visible Mode Doesn't Work: ECONNREFUSED HOT 5
- Can't make post request with payload and headers while stealth is on HOT 1
- Chromium fails to start
- Cloudlfare bypass doesnt work HOT 11
- cookieError while making request to server. HOT 2
- Node is installed, but not found. HOT 1
- check_hostname requires server_hostname while using proxy
- Detected by Twitter HOT 1
- Invalid image content when making request with use_stealth=True HOT 1
- CF blocks when using docker container HOT 2
- Is it possible to integrate custom scraping task in a class? HOT 1
- add features for scraper with the use of the ai
- Add option to disable folder making HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from botasaurus.