Posts by Tmilitino • 528 points
28 posts
-
2
votes1
answer51
viewsA: How to delete a character in Python
I believe you should change just as you are passing the data in the parameter columns, by the documentation this parameter receives a dict-like. All you have to do is exchange parentheses () by keys…
-
0
votes2
answers250
viewsA: Referencing Python Variables
Important to remember that in python string are immutable with this if passing an immutable type in a method will not be passed its reference, therefore it will not be possible to change. But if you…
-
0
votes2
answers1391
viewsA: Concatenate two Dataframes
You need to make the Cartesian product in those two dataframes. One option would be to use the merge, but it is necessary to create a key to connect these two dataframes, in case you call her k. And…
-
1
votes1
answer2482
viewsA: How to export data from a database to a CSV file?
With any language you can do this! If it is to keep in the same line of development you can use a python lib or pandas in it there is a function that will help you in this. This would be a simple…
-
0
votes1
answer81
views -
0
votes1
answer70
viewsA: Conversion of PDF images with Python
you can check if the file ends with .py and ignore it, using a condition with the function endswith class string. As example below. It would be one of the options. from PIL import Image import os…
-
0
votes2
answers2088
viewsA: I type the correct xpath from a button, but Selenium says xpath does not exist
I don’t know how this structure of html, but I believe that if you change the location of click() do up to the span instead of the button. like_button =…
-
1
votes1
answer815
viewsA: Save array to python CSV
With the very pandas you can do it, it ta function to_csv who does exactly what you want df.to_csv("crl.csv",index=False,sep=";") documentation and references: to_csv…
-
1
votes1
answer406
viewsA: Webdriver Firefoxdriver, run checkbox click
As I said in the comment, your code would look something like this, it would only change the element you were looking for. As the input is "covered up" by other elements it becomes more difficult to…
-
1
votes1
answer637
viewsA: Error running python script via python 2 terminal: "Ioerror: [Errno 2] No such file or directory:"
The error is on the line you set the file name, when you pass the / between the month and day this way name = '{}/{}'.format(m,d) he understands that he should fetch a folder in the root directory…
-
0
votes1
answer244
viewsA: Help with Chromium webdriver Selenium python3
You forget to put the .exe at the end of executable_path the correct would be executable_path = f'/usr/lib/chromium-browser/chromedriver.exe
-
1
votes1
answer1645
viewsA: Cumulative sum per line
To have the claim you want you have to call the cumsum() along with a function groupby() The function groupby() performs a grouping according to the columns you choose and allows you to perform…
-
2
votes1
answer327
viewsA: Changing characters from a python message
Your for is running through the lista_z but does nothing pq Voce does not use his variable for anything. to understand how the for lista_z=['z','p','x','c','v'] for z in lista_z: print(z) this way…
-
0
votes2
answers108
viewsA: Help in python Lists
Different from what you were using for, my suggestion is to use the pandas that already has some functions that will facilitate your work. follows an example of how the code would look. at the end…
-
1
votes4
answers134
viewsA: Mysql query involving Profession and Note information registered in the same column
You can do this in several ways, one of them is by creating two subtables, one that obeys the 1st condition and the other that obeys the 2nd condition. as in the example below. select…
-
2
votes1
answer326
viewsA: Check if Checkbox is checked
You have to make some changes to the code First of all you need to declare a variable that will store the change of status in the case of checkbox ele só terá dois estados0ou1` checkButtonSub =…
-
1
votes1
answer1336
viewsA: Load Chrome profile in Selenium
There are a number of things that need to be done. You are creating two drivers and passing the Options in the second and accessing the site in the first. What argument would be used in the…
-
3
votes2
answers123
viewsA: Python functions + lists
Simply why the return function within the for, if you put it out it will return the full list. novalista = [] def find_it(seq): number_list = seq for number in number_list: novalista.append(number)…
-
0
votes2
answers161
viewsA: Help Using List Comprehension/Dictionary
From what I saw the tvbd’s own API does not have the information from absoluteNumber for every episode, so it returns None. A solution would be to "create" your own absoluteNumber, as follows in the…
-
1
votes1
answer28
viewsA: Unexpected return of the method
The mistake runs because you’re trying to print in function instead of you calling her the correct would be clientes = Cliente('Joaquin',21,'04040505') print(clientes.dados()) something else its…
-
0
votes1
answer43
viewsA: Insert with Where where I don’t have full value
I’m guessing the id is the NUM_IMPRESSAO, what you need to do is a split and put the "." as the value to divide the string in a array. novoValor = str(id).split('.') novoValor = novoValor[-1] or use…
-
1
votes1
answer62
viewsA: Using two webdrives in Selenium
Following the idea of Pedro I used cookies. To do this I created two functions to s_cookies() and the l_cookies the first saves the cookies of the page already logged in and loaded and the second…
-
0
votes2
answers86
viewsA: Stalled Selenium test
I usually use the while this is an example in python, but only adapt the syntax to the language you are using. while True: try: time.sleep(1) #faz um teste para saber se já passou break except: #…
-
0
votes1
answer62
viewsQ: Using two webdrives in Selenium
I need to develop a script for automation of a website. I get a list of URLs I pass this list on a for that for each item in the list a new one is created webdriver and it asks to login to the site.…
-
0
votes1
answer148
viewsA: I would like to know how to find this Aria-label attribute in python xpath
Good morning, try it this way below. Selenium has a method get_attribute that does just that, something else doesn’t need to put the sign of equal(=) print("Resultado")…
-
1
votes1
answer805
viewsA: Sending e-mail with excel attachment - Python
Hello, it is possible to send any other extension of Excel by email. Looking at your code I made a small change in the attaching part of the file part = MIMEBase('application', "octet-stream")…
-
1
votes1
answer1398
viewsA: No-SQL database modeling
No-SQL database work with an idea of denormalization, roughly is to repeat the same value for several nodes. Firebase itself has a youtube channel that can help you. Helped me a lot to understand…
-
1
votes1
answer409
viewsA: how to work with different dimension in android studio?
Hello, from a researcher on screen densities. https://developer.android.com/guide/practices/screens_support.html?hl=pt-br this link is from the documentation of the android itself and addresses this…