import requests
indeed_resul = requests.get("https://www.indeed.com/jobs?q=pythin&limit=50")
print(indeed_resul.text)
import requests
from bs4 import BeautifulSoup
indeed_result = requests.get("https://www.indeed.com/jobs?q=pythin&limit=50")
indeed_soup = BeautifulSoup(indeed_result.text, "html.parser")
pagination = indeed_soup.find("div", {"class":"pagination"})
pages = pagination.find_all('a')
spans = []
for page in pages:
spans.append(page.find("span"))
print(spans[0:-1])
def plus(a, b, *args, **kwargs):
return
plus(1, 2, tree=true, tre4=true, hoo =true) // 키워드 무한으로 들어감
class Car(**kwargs):
def __init__(self, **kwargs):
self.color = kwargs.get("color", "black")
self.price = kwargs.get("price", "$20")
self.wheels = 4
def __str__(self):
return f"Car with {self.wheels} wheels"
porche = Car(color="green", price="$40")
print(porche.color, porche.price)
mini = Car()
print(mini.color, mini.price)
이거좀 신기하네
from flask import Flask
app = Flask("SuperScrapper")
@app.route("/")
def home():
return "hello! welcom to m "
@app.route("/<username>")
def loginuser(username):
return f"<h1>Contact Me!{username}</h1>"
app.run(host = "0.0.0.0")
이거는 뭔가 html 이용하기 빡샘
웹사이트 파이썬 flask 이용하여 만들기
from flask import Flask, render_template
app = Flask("SuperScrapper")
@app.route("/")
def home():
return render_template("hhh.html")
app.run(host = "0.0.0.0")
<!DOCTYPE html>
<html>
<head>
<title>
hovovofo
</title>
<h1>dododo</h1>
</head>
</html>
이것을 연동하기위한 방법 hhh.html 을 옥 templates 파일에 넣고 실행할것
신기한것
from flask import Flask, render_template, request
app = Flask("SuperScrapper")
@app.route("/")
def home():
return render_template("potato.html")
@app.route("/report")
def report():
word = request.args.get('word')
return render_template("hhh.html", searchingBy=word)
app.run(host = "0.0.0.0")
<!DOCTYPE html>
<html>
<head>
<title>
hovovofo
</title>
<h1>dododo</h1>
<h3>some thing fo<{{searchingBy}}/h3>
</head>
</html>
<!DOCTYPE html>
<html>
<head>
<title>
hovovofo
</title>
<h1>dododo</h1>
<form action="/report" method="get">
<input placeholder="Search for a job" required name="word" />
<button> Search</button>
</head>
</html>
이렇게 데이터 주고 받고 저장까지 가능
'nomadcoders 공부 심화' 카테고리의 다른 글
2주 첼린지~ 5일차 (nomadcoders) (0) | 2020.08.30 |
---|---|
2주 첼린지~ 4일차 (nomadcoders) (0) | 2020.08.28 |
2주 첼린지~ 3일차 (nomadcoders) (1) | 2020.08.28 |
2주 첼린지~ 2일차 (nomadcoders) (0) | 2020.08.28 |
2주 첼린지~ 1일차 (nomadcoders) (0) | 2020.08.28 |