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 bs4 import BeautifulSoup | |
url = 'https://www.wine.com/search/Capel%20Vale%20Winery%20Single%20Vineyard%20Kinnaird/0' | |
print(url) | |
r = requests.get(url) | |
if r.status_code == requests.codes.ok: | |
soup = BeautifulSoup(r.text, 'html.parser') | |
items = soup.select('ul.prodList li.prodItem') |
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
from flask import Flask, request, abort | |
from linebot import LineBotApi, WebhookHandler | |
from linebot.exceptions import InvalidSignatureError | |
from linebot.models import ( | |
MessageEvent, TextSendMessage, Sender | |
) | |
line_bot_api = LineBotApi('<Channel access token>') |
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 | |
import pandas as pd | |
from typing import Dict, List | |
class StockFinMind(): | |
def __init__(self): | |
self.base_url = 'https://api.finmindtrade.com/api/v4/data' | |
def request_get(self, parameter): |
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 bs4 import BeautifulSoup | |
headers = { | |
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36', | |
} | |
# 對"巴哈姆特動畫瘋"送出請求 | |
r = requests.get('https://ani.gamer.com.tw/', headers=headers) | |
if r.status_code == 200: |
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
{ | |
"operationName": "citySearch", | |
"variables": { | |
"CitySearchRequest": { | |
"cityId": 4951, | |
"searchRequest": { | |
"searchCriteria": { | |
"isAllowBookOnRequest": true, | |
"bookingDate": "2023-06-10T13:44:32.789Z", | |
"checkInDate": "2023-06-18T16:00:00.000Z", |