- Documentation

pymongo.readthedocs.io/en/stable/

 

PyMongo 3.11.2 Documentation — PyMongo 3.11.2 documentation

Getting Help If you’re having trouble or have questions about PyMongo, ask your question on our MongoDB Community Forum. You may also want to consider a commercial support subscription. Once you get an answer, it’d be great if you could work it back in

pymongo.readthedocs.io

main 필요없어서 체크 해지함
터미널 창에서 pymongo 설치
cp39은 python version 3.9라는 의미

만약 설치 문제가 있으면 wheel 파일 설치하기

www.wheelodex.org/projects/pymongo/

 

Wheelodex — pymongo

pymongo View on PyPI — Reverse Dependencies (838) Wheel Details Project: pymongo Version: 3.11.2 Filename: pymongo-3.11.2-cp39-cp39-manylinux2014_x86_64.whl Download: [link] Size: 518051 MD5: 727a7c310e57b9320c0b65ca6b7928a1 SHA256: 270a1f6a331eac3a39309

www.wheelodex.org

 

 

- 잘 설명되어 있음 

www.w3schools.com/python/python_mongodb_getstarted.asp

 

Python MongoDB

Python MongoDB Python can be used in database applications. One of the most popular NoSQL database is MongoDB. MongoDB MongoDB stores data in JSON-like documents, which makes the database very flexible and scalable. To be able to experiment with the code e

www.w3schools.com


* Ctrl+Space: 자동완성 띄움 

from pymongo import MongoClient

client = MongoClient('localhost', 27017)  # 안 적어도 똑같음
#client = MongoClient('localhost', 27017)  # 안 적어도 똑같음
#client = MongoClient('mongodb://127.0.0.1:27017')

for db_name in client.list_database_names():
    print(db_name)


-from ~ import ~ , import ~ 

from datetime import datetime

current_data_time = datetime.now() 
import datetime

current_data_time = datetime.datetime.now()

 

- 주가 확인하기 

1)

kabutan.jp/stock/?code=7203

화살표랑 Elements 클릭해서 원하는 곳 클릭

원하는 글 코드 찾아줌

<span class="kabuka">7,798円</span> 

 

-Terminal에서 설치 

pip install requests
pip install bs4

- url 주소넣기 / class_ 에 class 이름 넣기 

import requests
from bs4 import BeautifulSoup


url = "https://kabutan.jp/stock/?code=7203"
html = requests.get(url)
soup = BeautifulSoup(html.content, "html.parser")
stock = soup.find(class_="kabuka").text # html의 class라서 class_  
print(stock)

 

2)

회사에서 막았음

www.bloomberg.com/quote/GOOG:US

 

<span class="priceText__1853e8a5">1,740.18</span> 

import requests
from bs4 import BeautifulSoup


url = "https://www.bloomberg.com/quote/GOOG:US"
html = requests.get(url)
soup = BeautifulSoup(html.content, "html.parser")
stock = soup.find(class_="priceText__1853e8a5")
print(stock)

데이터가 없어서 안 나옴ㅠ

 

 

 

 

'mongodb' 카테고리의 다른 글

몽고디비 3일차- django, 장고  (0) 2021.01.18
몽고디비 3일차- 웹연동, postman  (0) 2021.01.18
몽고디비 3일차- studio 3t, mongodb tool  (0) 2021.01.18
몽고디비 2일차- pymongo, Altlas  (0) 2021.01.15
몽고디비 1일차  (0) 2021.01.14

+ Recent posts