-
Notifications
You must be signed in to change notification settings - Fork 3
TypeError: Wrong number or type of arguments for overloaded function 'Rule_extract' #27
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
Comments
Rule.extract does not accept a string, only import hext
rule = hext.Rule("<a href:link/>")
# (1) Ok, the argument for extract is of type hext.Html
results = rule.extract(hext.Html("""<a href="b"></a>"""))
# (2) Error, the argument for extract is of type string:
results = rule.extract("""<a href="b"></a>""") If this was possible in a previous version of Hext (≥1.0.0), please let me know, as this would be a breaking change in the API. The error message is unfortunately very unhelpful, and I will fix that in a future release with #28. Thank you for creating this issue. |
This was not possible in 0.8 (just re-tested to be sure). AFAIK you always needed to pass a Html object. |
Yes, it had been a while since I used hext, and I misremembered. Indeed As an aside, I think there really needs to exist at least one comprehensive page (or tabs) per supported programming language in the documentation. It would contain various necessary examples to train the user to use hext effectively. |
As an example, please see the organization and tabs here (one tab per supported language). |
I agree and have added another issue for this: html-extract/html-extract.github.io#4. |
With Python 3.12,
hext.Rule('').extract('')
gives the error:I am of course also getting this error with a more real-life example. At this time I cannot use hext for anything new.
The text was updated successfully, but these errors were encountered: