This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
op = webdriver.ChromeOptions() | |
driver = webdriver.Chrome("/app/chromedriver_84_linux",options=op) | |
while(1): | |
driver.get("https://the-url-of-some-website") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from selenium import webdriver | |
from fake_useragent import UserAgent | |
ua = UserAgent() | |
userAgent = ua.random | |
options.add_argument(f'user-agent={userAgent}') | |
options = webdriver.ChromeOptions() | |
driver = webdriver.Chrome("/app/chromedriver_84_linux",options) | |
while(1): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/project | |
/frontend | |
/backend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/project | |
package.json <--- this is the backend package.json | |
/front | |
/node-modules | |
/public | |
/src | |
.gitignore | |
package-lock.json | |
package.json <--- this is the frontend package.json | |
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
var cors = require('cors'); | |
let app = express(); | |
let port = process.env.PORT || 8080; | |
app.use(cors()); | |
app.get('/hello', function(req, res) { | |
res.json('Hello from backend !'); | |
}) | |
app.listen(port, () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "backend", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"server": "nodemon index.js" | |
}, | |
"author": "", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect } from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
function App() { | |
const [message, setMessage] = useState(''); | |
// Send a request to the server on port 8080 to retrieve message | |
useEffect(() => { | |
fetch('http://localhost:8080/hello') | |
.then(response => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "course-lookup-front", | |
"version": "0.1.0", | |
"private": true, | |
... | |
"proxy": "http://localhost:8080" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
var cors = require('cors'); | |
let app = express(); | |
let port = process.env.PORT || 8080; | |
var path = require('path'); | |
app.use(cors()); | |
if(process.env.NODE_ENV === 'production'){ | |
// If running in production mode enter here | |
app.use(express.static(path.join(__dirname, 'front/build'))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "backend", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"server": "nodemon index.js", | |
"start": "NODE_ENV=production nodemon index.js" | |
}, |
OlderNewer