-
Notifications
You must be signed in to change notification settings - Fork 19
Alteração da função wait_for_download() em botcity>web>bot.py #108
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
base: main
Are you sure you want to change the base?
Alteração da função wait_for_download() em botcity>web>bot.py #108
Conversation
Olá Gabriel, obrigado por contribuir com este pull request. Preciso saber coisas mais especificas sobre o problema para averiguarmos e testarmos do nosso lado também, que seriam:
Seria interessante também abranger mais o que você estava tentando fazer para termos uma visão melhorar do problema. Estarei esperando sua resposta. Hello, Gabriel; thank you for contributing to this pull request. I need to know more specific details about the issue so we can investigate and test it on our side as well, which would be:
It would also be helpful to provide more context about what you were trying to do so we can better understand the problem. I’ll be waiting for your response. |
Fala Kayque. Tudo bem?
Vou tentar mandar o que tenho.
- Operating system version *Windows 10 Pro 64*
- Browser and version used : estou usando o *ChromeDriverManager()
aparentemente na v. 114.0.5735.90*
bot.browser = Browser.CHROME
bot.driver_path = ChromeDriverManager().install().replace(
'/THIRD_PARTY_NOTICES.chromedriver', '/chromedriver.exe')
- Botcity package version.
[image: image.png]
- Error traceback.
[image: exception.png]
Minha automação acessa uma lista de processos judiciais e faz o download
desse processo, renomeia e envia para o Google Drive via API. Mas às vezes
a automação encerra antes de todos os processos terem o download
completado, então usei o *wait_for_download().* Acontece que ele fica
eternamente na tela e não continua o código para dar o *stop_browser()* e
encerrar a automação corretamente, caindo no TimeoutException sempre, mesmo
quando o último download conclui
meu bloco de código
[image: image.png]
o download_folder_path() também estava configurado corretamente, mas mesmo
assim o downloads_count sempre permanecia no 0.
Fui tentando linha por linha dentro do código do pacote mesmo pra ver o que
poderia ser e vi que o* primeiro if não estava sendo acessado*
[image: image.png]
Tentei rodar em headless mas o 'bug' se manteve. Foi quando decidi tirar o
"and self.headless" e aparentemente tudo funcionou como deveria. O
navegador fechou quando o último download terminou e o browser encerrado
corretamente, não caindo mais no Exception do meu try/except
Espero que possa ter ajudado.
Att,
…On Mon, Sep 9, 2024 at 6:51 PM Kayque Govetri ***@***.***> wrote:
@gabrielms-castro <https://github.com/gabrielms-castro>
Olá Gabriel, obrigado por contribuir com este pull request.
Preciso saber coisas mais especificas sobre o problema para averiguarmos e
testarmos do nosso lado também, que seriam:
- Versão do sistema operacional.
- Navegador utilizando e versão.
- Versão do pacote da botcity.
- Traceback do erro.
Seria interessante também abranger mais o que você estava tentando fazer
para termos uma visão melhorar do problema.
Estarei esperando sua resposta.
------------------------------
Hello, Gabriel; thank you for contributing to this pull request.
I need to know more specific details about the issue so we can investigate
and test it on our side as well, which would be:
- Operating system version.
- Browser and version used.
- Botcity package version.
- Error traceback.
It would also be helpful to provide more context about what you were
trying to do so we can better understand the problem.
I’ll be waiting for your response.
—
Reply to this email directly, view it on GitHub
<#108 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AUB6VCWTGQMA7I7JBH4D4UDZVYJ73AVCNFSM6AAAAABNVDSZNGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZZGIYTOOJQGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Olá @gabrielms-castro , não estou conseguindo visualizar as imagens, mas consegui entender a situação, gostaria de pedir para que você tentasse algumas abordagens diferentes.
Essa versao tem algumas correções e utiliza o selenium 4, pode ser que tenha que mudar algumas coisas em seu código após essa modificação. Estarei esperando sua resposta. I can't view the images, but I understand the situation. I would like to ask you to try a few different approaches. Install the version from the main branch via your I'll be waiting for your response. |
Boa tarde, Kayque. tudo bem?
então, eu removi o framework e instalei direto do github como vc me disse
mas aí o erro voltou.
Traceback (most recent call last):
File "D:\BAS_BOTMAKER\bas_botmaker\downloaders\downloader_pje\main.py",
line 460, in <module>
main()
File "D:\BAS_BOTMAKER\bas_botmaker\downloaders\downloader_pje\main.py",
line 449, in main
bot.wait_for_downloads(timeout=30000)
File
"C:\Users\gabri\AppData\Local\pypoetry\Cache\virtualenvs\bas-botmaker-uoGDbraN-py3.12\Lib\site-packages\botcity\web\bot.py",
line 1241, in wait_for_downloads
WebDriverWait(self._driver, timeout/1000.0, 1).until(wait_method)
File
"C:\Users\gabri\AppData\Local\pypoetry\Cache\virtualenvs\bas-botmaker-uoGDbraN-py3.12\Lib\site-packages\selenium\webdriver\support\wait.py",
line 105, in until
raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:
só funciona quando removo o 'and self.headless' do if mesmo.
…On Thu, Sep 12, 2024 at 1:51 PM Kayque Govetri ***@***.***> wrote:
Olá @gabrielms-castro <https://github.com/gabrielms-castro> ,
não estou conseguindo visualizar as imagens, mas consegui entender a
situação, gostaria de pedir para que você tentasse algumas abordagens
diferentes.
- Instale a versão da branch main pelo seu requirements.txt: botcity-framework-web
@ ***@***.***
Essa versao tem algumas correções e utiliza o selenium 4, pode ser que
tenha que mudar algumas coisas em seu código após essa modificação.
Se conseguir testar dessa forma e dar um feedback. Se possível tente
enviar as imagens corretamente também que já melhora nossa visualização.
Estarei esperando sua resposta.
------------------------------
I am unable to view the images, but I managed to understand the situation.
I would like to ask you to try a few different approaches.
Install the version from the main branch via your requirements.txt file:
botcity-framework-web @ git+
***@***.***
This version includes some fixes and uses Selenium 4, so you might need to
make some adjustments to your code after this change. If possible, test it
this way and provide feedback. Also, please try to send the images
correctly to improve our visibility.
I'll be waiting for your response.
—
Reply to this email directly, view it on GitHub
<#108 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AUB6VCRTC2LLGXGTWW57T2TZWHBBFAVCNFSM6AAAAABNVDSZNGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBWG44TENZUGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Ola @gabrielms-castro, nos testes unitários que possuimos a função está funcionando na ultima versão do windows com o Chrome, consegue me passar as imagens novamente (elas estão com erro.) Hello @gabrielms-castro, In the unit tests we have, the function is working on the latest version of Windows with Chrome. Could you please send me the images again (they are showing an error)? |
estou enviando as fotos como anexo, Kayque. Espero ajudar.
…On Thu, Sep 12, 2024 at 5:01 PM Kayque Govetri ***@***.***> wrote:
Ola @gabrielms-castro <https://github.com/gabrielms-castro>,
nos testes unitários que possuimos a função está funcionando na ultima
versão do windows com o Chrome, consegue me passar as imagens novamente
(elas estão com erro.)
------------------------------
Hello @gabrielms-castro <https://github.com/gabrielms-castro>,
In the unit tests we have, the function is working on the latest version
of Windows with Chrome. Could you please send me the images again (they are
showing an error)?
image.png (view on web)
<https://github.com/user-attachments/assets/1daa034b-1fec-4fc1-b850-11a5f17d117e>
—
Reply to this email directly, view it on GitHub
<#108 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AUB6VCQPM5GABQ4NMDQUBRDZWHXIXAVCNFSM6AAAAABNVDSZNGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBXGEZTCNJWGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Boa tarde, prezado.
Eu estava com um problema numa automação em que precisava utilizar o wait_for_download() e percebi que estava dando erro em todas minhas tentativas.
Olhando um pouco a função na biblioteca, experimentei "debugar" a função com
print()
mesmo e percebi que oif
não estava inicializando e sempre caia noTimeoutException
.Experimentei remover o
and self.headless
doif
na linha 1218 e funcionou perfeitamente na minha automação.Poderiam testar e ver se faz sentido?
Obrigado, pela sua atenção.
Att,
Gabriel Castro