jSoupLink icon indicating copy to clipboard operation
jSoupLink copied to clipboard

`:containsData` don't work

Open Juddd opened this issue 1 year ago • 12 comments

As your link point: image image

I find some available Selector APIs. But why this code will report error:

obj = Import["https://stackexchange.com", "HTMLDOM"];
obj["Select", ":containsData(fkey)"]

Juddd avatar Jun 25 '23 17:06 Juddd

Hi. What is the error message? The copy of the library in jsoupLink hasn't been updated for some time and it's possible that they have introduced new features since then. This is one possibility.

cekdahl avatar Jun 26 '23 10:06 cekdahl

This is the error message: Snipaste_2023-06-26_18-45-24 It's a wonderful library, but unfortunately, not many users seem to know it exists

Juddd avatar Jun 26 '23 10:06 Juddd

It's likely that it was introduced in a later version of Jsoup, so Jsoup has to be updated for this to work.

cekdahl avatar Jun 27 '23 07:06 cekdahl

@Juddd and @cekdahl, I took the liberty of forking jsoupLink (felixkasza/jsoupLink) and updating the jar file to 1.17.2; this works just fine now:

obj = Import["https://stackexchange.com", "HTMLDOM"];
obj["Select", ":containsData(fkey)"]

(I also updated the file structure and the PacletInfo to current (v12.3+) Mathematica standards.)

felixkasza avatar May 15 '24 19:05 felixkasza

@felixkasza This looks really good. As it happens, I am actually about to release the first new version of jsoupLink in years, and this looks like it could help.

cekdahl avatar May 16 '24 06:05 cekdahl

@cekdahl That'll be my first PR ever, then (yay?). And thanks, by the way, for jsoupLink in the first place. I love it!

felixkasza avatar May 16 '24 07:05 felixkasza

@felixkasza I will upload my updates in the coming days, then you can make PR on top of that. I am currently taking the steps necessary to submit the package to WR's package repository.

cekdahl avatar May 16 '24 16:05 cekdahl

Excellent, thanks! I'll cancel the current PR.

felixkasza avatar May 16 '24 19:05 felixkasza

@felixkasza I have the updates I intended to make on a branch (some updates to e.g. the README still to come): https://github.com/cekdahl/jSoupLink/tree/feature/rel1.1

I'm using the jsoupLink.nb to build it. CreatePacletArchive@"jsoupLink" creates the paclet file, but when I run PacletInstall[%, "IgnoreVersion" -> True] then it prints the following error message:

image

Your branch had a lot of information about building the paclet in it. Do you see what's wrong?

cekdahl avatar Jun 09 '24 20:06 cekdahl

Let me grab that branch and have a look.

Edited because Github's mail-to-comment conversion sucks.

felixkasza avatar Jun 09 '24 20:06 felixkasza

OK, the underlying issue is the use of the PackPacklet[] function (as opposed to the newer PacletTools stuff); PackPaclet[] does not do the current style of documentation (and the way PackPacklet[] wants it is undocumented, AFAIK).

I took the liberty of bringing everything up to the current (MMA 12.3+) rules expectations and adding a new build script and manual build instructions; the PR is in #8. Conversely, I would retire the current jsoupLink.nb.

felixkasza avatar Jun 10 '24 13:06 felixkasza

Thank you for the fast response. I didn't have time today, but I'll try to have a look at it tomorrow.

cekdahl avatar Jun 10 '24 22:06 cekdahl