2 回答

TA貢獻1801條經驗 獲得超16個贊
使用瀏覽器的開發人員工具,您可以檢查按鈕元素并查看它們是否必須onClick執行功能getCompYData。該函數定義為:
function getCompYData(t, a, b) {
$("#yearlySmbData").empty(), $("#mheader").html(b), $.post("annQtrStmts.php", {
name: "get_comp_y_data",
smbCode: t,
year: a
}, function(t) {
obj = JSON.parse(t), $("#yearlySmbData").createTable(obj, {})
})
}
annQtrStmts.php通過使用name字符串(例如 AABS)和年份(例如 2020)執行 HTTP POST 請求,smbCode您應該能夠訪問相應的文件。
請記住,這樣做可能違反本網站的條款和條件。
編輯:根據更新的問題,您實際上想要查看此功能:
function getCompData() {
var t = $("#country").val();
$(".nav-link").removeClass("active"), $("#yearlyData").empty(), $("#annRpt").html("Financial Reports <br><br>" + $("#country option:selected").text() + " ( " + t + " )"), $.post("annQtrStmts.php", {
name: "get_comp_data",
smbCode: t
}, function(t) {
obj = JSON.parse(t), $("#yearlyData").createTable(obj, {})
})
}
端點是相同的,但在這種情況下,您傳遞的是不同的字符串并且沒有年份。

TA貢獻1805條經驗 獲得超9個贊
import requests
from bs4 import BeautifulSoup
def getMyUrl(*arg):
# print(arg)
for _ in arg:
if requests.head(_).status_code == 200:
soup = BeautifulSoup(requests.get(_).text, "html.parser")
for a_tag in soup.findAll("a"):
print(a_tag.attrs.get("href"))
#Use this like
if __name__ == "__main__":
getMyUrl("https://www.google.com", "https://example.com")
添加回答
舉報