-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fix scraper not filling input when looking for INGENIERIA EN COMPUTACION
#646
Conversation
INGENIERIA EN COMPUTACION
lib/scraper/bedelias.rb
Outdated
if page.has_css?('.ui-widget-overlay', wait: 5) | ||
page.assert_no_selector('.ui-widget-overlay') | ||
end |
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.
Me gusta la idea! Primero preguntás si está el modal y aguantás un rato hasta que aparezca. Si aparece esperás a que desaparezca. Si no aparece, quizás significa que ya apareció y se fue antes de hacer el chequeo por lo que seguirías de largo y en ese caso, en teoría, la página debería estar lista para usar el input del buscador.
La única pregunta que tengo es, es necesario el wait
? Creo que por defecto Capybara espera dos segundos a que aparezca
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.
buena observación, no había necesidad de agregarlo :)
3c585ec
to
58f5ead
Compare
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.
Bien metida!! 🚢
lib/scraper/bedelias.rb
Outdated
if page.has_css?('.ui-widget-overlay') | ||
page.assert_no_selector('.ui-widget-overlay') | ||
end |
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.
if page.has_css?('.ui-widget-overlay') | |
page.assert_no_selector('.ui-widget-overlay') | |
end | |
if has_css?('.ui-widget-overlay') | |
assert_no_selector('.ui-widget-overlay') | |
end |
58f5ead
to
3902cb4
Compare
El scraper esta teniendo un comportamiento flaky, en el que el input de buscar la carrera muchas veces no se llena.
El motivo es la aparición de este widget de que la pagina esta cargando:

Esperar a saber que estamos en la pagina de buscar carreras haciendo find('span', text: 'Planes de estudio - FING').
Esto lo hacemos para no matchear con el widget de la pagina anterior.
Esperar a ver si aparece el widget
.ui-widget-overlay
, y hasta que no se vaya no usar el input.