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

fix(web-extract): fix the extractor may fail if there is no <body/> #76

Merged
merged 7 commits into from
Aug 28, 2024

Conversation

yuyutaotao
Copy link
Collaborator

@yuyutaotao yuyutaotao commented Aug 27, 2024

  1. fix the extractor may fail if there is no
  2. log the dump file when locator fails
  3. collect div with aria attributes

Copy link

netlify bot commented Aug 27, 2024

Deploy Preview for midscene ready!

Name Link
🔨 Latest commit 3577afb
🔍 Latest deploy log https://app.netlify.com/sites/midscene/deploys/66cf0730f8f7a2000826438d
😎 Deploy Preview https://deploy-preview-76--midscene.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -212,6 +213,31 @@ export function extractTextWithPosition(
return;
}

if (isWidgetElement(node)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么这里是判断有没有 aria 属性就是 form 元素了

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是不是直接判断可见性,如果这个节点不是 input、img、text,并且是可见的有宽高的,我们就把他加到里面去,类型是 container,是不是可以减少类似的问题

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不过这里需要避免子节点再次被添加直接 return 返回空就行了,这样子节点不会再次被遍历,到这里就终止了

@zhoushaw zhoushaw changed the title fix: fix the extractor may fail if there is no <body/> fix(web-extract): fix the extractor may fail if there is no <body/> Aug 28, 2024
@zhoushaw zhoushaw merged commit f8fdf60 into main Aug 28, 2024
8 checks passed
@zhoushaw zhoushaw deleted the fix/extractor-on-body branch September 4, 2024 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants