Posts by Matheus Andrade • 27 points
6 posts
-
0
votes3
answers42
viewsQ: How to simplify these two methods?
Well, in my class there are two magical methods, add and sub: def __add__(self, other): if other.__m == self.__m and other.__n == self.__n: result = [] for i in range(other.__m): lst = [] for j in…
-
-1
votes1
answer222
viewsQ: I want to scrap a page, but I can’t get a text that has " " on it
Well, the title says it all, I want to get the price of a product from the site https://www.pontofrio.com.br/, like this: <span class="nm-price-value"…
-
1
votes3
answers178
viewsA: is not accumulating values in the lists
I don’t quite understand if you want the function to return two integers or one, but anyway, the indentation is disorganized, and you’re adding it wrong. The right way would be: for i in range(5):…
-
0
votes2
answers42
viewsQ: If a function is too long, is it recommended to divide it into smaller ones?
I have the following function, which I intend to extend: def get_dataframe(site, search): if site == 'pichau': try: soup = get_page(f'https://www.pchau.com.br/catalogsearch/result/?q={search}')…
-
0
votes1
answer62
viewsQ: I can’t do the "web scraping" properly from a Python comic strip site
Well, I was making a code that would check the day of each strip/gif of the page and, if the day is the same as the current day (in the code I put 14 only because the site does not update weekend…
-
1
votes2
answers824
viewsQ: Read a csv file and add your data into a dictionary
I have a code where I will have a function that will pass the data from a csv file to a dictionary. The process will be to take the films with their respective notes and add to a dictionary relative…