()
| 1 | from curl_cffi import requests |
| 2 | import pyquery |
| 3 | |
| 4 | def get_3dm_data(): |
| 5 | url = "https://www.3dmgame.com/phb.html" |
| 6 | headers = { |
| 7 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" |
| 8 | } |
| 9 | res = requests.get(url, headers=headers, timeout=30, impersonate="chrome") |
| 10 | doc = pyquery.PyQuery(res.content) |
| 11 | items = doc(".Phbright>.phlist").items() |
| 12 | data = [] |
| 13 | for item in items: |
| 14 | title = item.find(".bt>a").text() |
| 15 | link = item.find(".bt>a").attr("href") |
| 16 | hotScore = item.find(".score_a>span").text() |
| 17 | data.append({ |
| 18 | "title": title, |
| 19 | "url": link, |
| 20 | "hotScore": hotScore |
| 21 | }) |
nothing calls this directly
no outgoing calls
no test coverage detected