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

⬆️ Bump JsoupXpath from 2.5.1 to 2.5.3 #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Mar 7, 2023

Bumps JsoupXpath from 2.5.1 to 2.5.3.

Release notes

Sourced from JsoupXpath's releases.

V2.5.3

优化following-sibling following preceding-sibling preceding 行为,以便更好的适配文本提取场景,如下:

    @Test
    public void issue64And65(){
        String content = "<div class='a'>1</div>" +
                "<div>2</div>\n" +
                "<div class='a'>3</div>\n" +
                "<div>4</div>\n" +
                "<div>5</div>11" +
                "<tag>6</tag>12" +
                "<div>7<span>8</span></div>" +
                "";
        JXDocument j = JXDocument.create(content);
        Assert.assertEquals("7", j.selNOne("//div[text()='5']/following-sibling::div/text()").asString());
        Assert.assertEquals("6", j.selNOne("//div[text()='5']/following-sibling::tag/text()").asString());
        Assert.assertEquals("11", j.selNOne("//div[text()='5']/following-sibling::text()").asString());
        Assert.assertEquals("12", j.selNOne("//div[text()='7']/preceding-sibling::text()").asString());
        Assert.assertEquals("5", j.selNOne("//div[text()='7']/preceding-sibling::div/text()").asString());
        Assert.assertEquals("6", j.selNOne("//div[text()='7']/preceding-sibling::tag/text()").asString());
        Assert.assertEquals("6", j.selNOne("//div[text()='7']/preceding-sibling::tag/text()").asString());
        Assert.assertEquals("11 6 12 7 8", j.selN("//div[text()='5']/following::text()").stream().map(Objects::toString).collect(Collectors.joining(" ")).trim());
        Assert.assertEquals("6", j.selN("//div[text()='5']/following::tag/text()").stream().map(Objects::toString).collect(Collectors.joining(" ")).trim());
        Assert.assertEquals("8", j.selN("//div[text()='5']/following::span/text()").stream().map(Objects::toString).collect(Collectors.joining(" ")).trim());
        Assert.assertEquals("5 7", j.selN("//div[text()='4']/following::div/text()").stream().map(Objects::toString).collect(Collectors.joining(" ")).trim());
        Assert.assertEquals("2 1", j.selN("//div[text()='3']/preceding::text()").stream().map(Objects::toString).collect(Collectors.joining(" ")).trim());
        Assert.assertEquals("3  2 1", j.selN("//div[text()='4']/preceding::text()").stream().map(Objects::toString).collect(Collectors.joining(" ")).trim());
    }

以及豆瓣详情页提取测试:

    @Test
    public void testDoubanDetailInfoExtra() throws Exception{
        JXDocument doc = createFromResource("d_detail_page.html");
        JXNode score = doc.selNOne("//*[@id=\"interest_sectl\"]/div/div[2]/strong/text()");
        logger.info("{}", score.asString());
        JXNode title = doc.selNOne("//*[@id=\"wrapper\"]/h1/span/text()");
        logger.info("{}", title.asString());
        JXNode pageNum = doc.selNOne("//*[@id=\"info\"]/span[contains(text(),'页数')]/following-sibling::text()");
        logger.info("{}", pageNum.asString());
        Assert.assertEquals("956", pageNum.asString());
        JXNode price = doc.selNOne("//*[@id=\"info\"]/span[contains(text(),'定价')]/following-sibling::text()");
        logger.info("{}", price.asString());
        Assert.assertEquals("139.00元", price.asString());
    }

v2.5.2

  • last() 优化

... (truncated)

Commits
  • ec9f18f v2.5.3
  • 1699d13 v2.5.3
  • 408d01f Merge branch 'improve-sibling'
  • e95a729 增加测试用例
  • 40f5924 preceding-sibling/following-sibling/preceding/following 优化
  • a0f9122 preceding-sibling/following-sibling/preceding/following 优化
  • 299a655 优化following-sibling
  • 599a970 v2.5.2
  • b014485 v2.5.2
  • ff3427e Merge pull request #74 from zhegexiaohuozi/dependabot/maven/org.jsoup-jsoup-1...
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [JsoupXpath](https://github.com/zhegexiaohuozi/JsoupXpath) from 2.5.1 to 2.5.3.
- [Release notes](https://github.com/zhegexiaohuozi/JsoupXpath/releases)
- [Commits](zhegexiaohuozi/JsoupXpath@v2.5.1...v2.5.3)

---
updated-dependencies:
- dependency-name: cn.wanghaomiao:JsoupXpath
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants