fix(16personalities): fix scraping logic#60
Conversation
| image: /(?:fe)?male/i.exec(document.querySelector(".result__outline+div a.sp-button").href)[0], | ||
| text: document.querySelector("#intro .content__inner > div:first-child > p:first-of-type").innerText, | ||
| }, | ||
| traits: [...document.querySelectorAll(".traitbox")].map(box => { |
| text: document.querySelector("#intro .content__inner > div:first-child > p:first-of-type").innerText, | ||
| }, | ||
| traits: [...document.querySelectorAll(".traitbox")].map(box => { | ||
| const valueEle = box.querySelector(".traitbox__value") |
| const valueEle = box.querySelector(".traitbox__value") | ||
| const rawScore = valueEle.querySelector("span").innerText | ||
| return { | ||
| category: box.querySelector(".traitbox__label").innerText, |
This comment has been minimized.
This comment has been minimized.
|
Hmm looks like I can't add reviewers myself, @lishaduck sry for the ping. Ty! |
This comment has been minimized.
This comment has been minimized.
check-spelling run (pull_request_target) for fix/plugin-16personalities Signed-off-by: check-spelling-bot <check-spelling-bot@users.noreply.github.com> on-behalf-of: @check-spelling <check-spelling-bot@check-spelling.dev>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Thanks for the review. Unfortunately AI tools are only as good as their users... It's hard to maintain open-source projects these days, thanks for your effort 🫡 |
|
@lishaduck By the way, I don't think I have access to approve workflows or merge (both this one and #61), so might still need your help with that. Cheers. |
Yeah, I usually have enough confidence in my CI workflows' security I let anybody trigger them but I turned that off for this because they're 100% vulnerable, just haven't gotten the chance to tighten them up yet. Just triggered it, I'll merge once they're green. |
|
Ah crap, I thought merging main wouldn't have invalidated CI approvals (like code review approvals) but I guess I was wrong :( Might need another approval, my bad. |
Fixes lowlighter#1601. Dug around a little bit and changed the selectors to match the latest 16Personalities reports. The generated images for the placeholder profile are below:
They seem to compare pretty well to the original screenshot from lowlighter#1402.
There are some very hacky workarounds (e.g. avatars for personality types are no longer on the page and need to be constructed manually based on gender, which is extracted from the URL of the "Download fact sheet" button), but they seem to work at least for the time being, so hopefully that's OK.