codeliftsleep
Board Regular
- Joined
- Apr 14, 2017
- Messages
- 103
I am having an issue which has been driving me crazy trying to figure out. We have a site at work that we have to pull large amounts of data from every day. I created a web scraper which works perfectly fine for me, but for some reason others have issues using the same site. I have ruled out it being a computer issue, because I have gone on their computer, logged in under my name on the site and it works perfectly fine.
The problem is, the "Next Page" click event doesn't work with some users. It finds the button, fires the click event and nothing happens. When I log in, it fires the event with no issue. I have tried everything to get it to work. I tried to use:
<code>inputElement.FireEvent("on-click") (with a "-" included because it turns them into ****** otherwise???)
inputElement.click
</code>I am unsure how a click event can work or not work via code based on who the user is. Physically clicking on the button still works, just not firing the on-click event via code for some users(it works for me, most importantly).
Here are the relevant parts:
<code>Dim inputElement As HTMLInputElement
For Each inputElement In Document.getElementsByTagName("button")
If inputElement.Value = "Next Page" Then
Set inputElement = inputElement 'we set the next page button
Exit For
End If
Next inputElement
inputElement.Click
</code>I have checked and the button is always the right button, no matter the user, so that isn't an issue. I have to loop through the buttons to find the right one because it has no id, name or class.
Any ideas? This one is really baffling to me.
The problem is, the "Next Page" click event doesn't work with some users. It finds the button, fires the click event and nothing happens. When I log in, it fires the event with no issue. I have tried everything to get it to work. I tried to use:
<code>inputElement.FireEvent("on-click") (with a "-" included because it turns them into ****** otherwise???)
inputElement.click
</code>I am unsure how a click event can work or not work via code based on who the user is. Physically clicking on the button still works, just not firing the on-click event via code for some users(it works for me, most importantly).
Here are the relevant parts:
<code>Dim inputElement As HTMLInputElement
For Each inputElement In Document.getElementsByTagName("button")
If inputElement.Value = "Next Page" Then
Set inputElement = inputElement 'we set the next page button
Exit For
End If
Next inputElement
inputElement.Click
</code>I have checked and the button is always the right button, no matter the user, so that isn't an issue. I have to loop through the buttons to find the right one because it has no id, name or class.
Any ideas? This one is really baffling to me.
Last edited: