Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
BeautifulSoup logic in separate file #56
base: master
Are you sure you want to change the base?
BeautifulSoup logic in separate file #56
Changes from 5 commits
5ec6547
50efe5f
e1e46d2
8ac0977
42ffea0
ec0dcb5
ca84c3e
4234720
6342d7a
6e6b987
3faccda
34358c8
b789612
06a5df1
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
won't it always take the last output of the
select_one
? It's not adding, for every iteration it re-assignsselectedElems
with the new value. No? or is it expected?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is what is expected. Each new iteration overrides a variable selectedElems
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then I don't get it, does it supposed to return:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we take the object, apply the method select_one with selector 1 to it, then apply the method select_one with selector 2 to the received object, then apply the method select_one with the selector X to the received object and return the object or False
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you please provide real example from smarsy website? expected call with expected result?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From issue#51
<TD valign=top align="left" width="120"><img src="https://smarsy.ua/images/mypage/parent_1.png"></TD>
We must find td with valign=top and in received object find img[src]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and what would be the function call for that html?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
html.select_one([valign=top]).select_one('img[src]')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will it work? Additionally here you are passing single value parameter, but in your function you are expecting array. Please provide an example with array
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this test. It works with any selector values and with any quantity of them. What's the purpose of it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure what was done for this one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I refactored this test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as you are testing the fact that you are getting the output of the
get
function, then you should useself.mocked_soup.get.return_value
instead of hardcodingsome text
in the assertThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you saw latest commit?
def test_bs_safe_get_return_expected_text(self):
actual = self.source_page.bs_safe_get(self.mocked_soup, self.expected_attribute)
self.assertEqual(actual, self.expected_text)