Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[config] Add sources #40

Merged
merged 6 commits into from
Dec 19, 2023
Merged

[config] Add sources #40

merged 6 commits into from
Dec 19, 2023

Conversation

YDX-2147483647
Copy link
Owner

@YDX-2147483647 YDX-2147483647 commented Aug 20, 2023

Relates-to: #24
Resolves #55
Resolves #56

已知的问题

国际组织创新学院网页的<style>内容不合法,多个}。JSDOM 会转到 stdout,不过不throw

@media screen  and (min-width:996px){.gp-pc-layout-pid-409a2923-67a5-4fc4-8a38-1f5651230f8d:nth-child(1){width: 2
40px;}.gp-pc-layout-pid-409a2923-67a5-4fc4-8a38-1f5651230f8d:nth-child(2){flex: 1;}}}

https://www.npmjs.com/package/jsdom#virtual-consoles

@YDX-2147483647
Copy link
Owner Author

Deno-dom 更接近浏览器,没有<style>不合法的问题。

$ deno
Deno 1.38.0
> import { DOMParser } from "https://deno.land/x/deno_dom/deno-dom-wasm.ts";
undefined
> const r = await fetch('https://sgg.bit.edu.cn/tzgg/index.htm')
undefined
> const doc = new DOMParser().parseFromString(await r.text(), 'text/html')
undefined
> doc.querySelector('ul.block-list160 > li').innerText
"   2023-10-29   【讲座预告】百家大讲堂 | 全球发展、科技治理和联合国   "

Relates-to: #48

@YDX-2147483647 YDX-2147483647 marked this pull request as ready for review December 19, 2023 10:54
@YDX-2147483647
Copy link
Owner Author

不合法 HTML 是小问题,记到 #57,以后再说吧。

Relates-to: #24
Resolves #55
Resolves #56
@YDX-2147483647 YDX-2147483647 merged commit a32b011 into main Dec 19, 2023
@YDX-2147483647 YDX-2147483647 deleted the sources branch December 19, 2023 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

添加通知来源:资实 添加通知来源:招采
1 participant