-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Allow flavor argument to read_html to be list/instance of _HtmlFrameParser #4594
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
@cancan101 Would you like to submit a PR? |
@cpcloud Sure. |
pushing to 0.14 |
@cancan101 I think it's confusing to allow an instance of some internal class in a public API function. However, I am definitely open to discussing some kind of extension API ... since, well, there really isn't one. |
agree with @cpcloud. Internal class shouldn't be an option for public function. |
Why don't you have a publicly extendable 'Style' class or something that can be passed in (or inherited) and passed in? (I think that we are tlaking about this for the output formatters as well) |
bikeshedding alert: i think a in any case .. good idea |
I agree with the statement that internal classes should not be used in a public API. That being said, what is the difference between the proposed |
It could potentially be that simple, but there would need to be a way register flavors ... that's not hard, it's just not there yet |
@cpcloud I am looking to tackle this. My initial thought it to allow passing in "user defined parsers". The simplest solution would be to allow the flavor argument to be a " A couple of questions/ thoughts:
In addition, I COULD add the ability to register the flavor so that the user can than use a string rather than passing in the class/ object itself. I am indifferent to this and am okay just passing in the class/object and no bothering about the string indirection. |
I read this as the original topic being voted down and any work on a "flavor" (?) needs it's own You are of course free to open a new issue and discuss any problems that need addressing, |
I think it should be called |
Currently the
flavor
argument toread_html
must either beNone
or a string or a container of strings. This make is difficult for the user to write his own instance of_HtmlFrameParser
and to use that when parsing. I suggest also allowing the user to pass in a subclass of_HtmlFrameParser
in place of a string.Implementation wise, this should be easy.
_parser_dispatch
would be modified to for this case. Likewise_validate_parser_flavor
would need to allow this.The text was updated successfully, but these errors were encountered: