sparklemotion / mechanize

Mechanize is a ruby library that makes automated web interaction easy.
https://www.rubydoc.info/gems/mechanize/
MIT License
4.39k stars 473 forks source link

Error 403 on heroku #603

Closed imucyou closed 1 year ago

imucyou commented 1 year ago

We are using on heroku are having 403 error problem. I tried changing proxy but still can't work while running on windows 10 still normal For example Link: https://www.dacardworld.com/ I tried 2nd time in windows 10 it works, but on heroku it gives 403 error (it's not proxy related) i'm not sure if this is a library bug or heroku's, can you help check them?

flavorjones commented 1 year ago

The HTTP 403 Forbidden response status code indicates that the server understands the request but refuses to authorize it. You may want to consider that your IP addresses (or the address blocks used by Heroku) are being blocked by the server.

If you can provide more information that shows the library is behaving differently and that behavior is not under your control, I can try to help. You may wish to start with turning on logging and seeing if the request/response cycle is different, particularly looking at headers.

An example of how to turn on debug logging is at https://github.com/sparklemotion/mechanize/blob/main/examples/rubygems.rb