1

I am trying to download all hidden inputs and outputs for particular problems in practice.geeksforgeeks.com. Since they don't provide any API's, I tried something like this

complete_input = sys.stdin.read()
print(complete_input)

Example

It will print entire input and with the help of web scraping I can copy the inputs. And I can use selenium to copy the inputs to the expected output field to get corresponding output.
But the problem is if the input is large, That website will display only the small part of standard output. Is there any way to change source code in that website using chrome web developer tools and make it display entire content. Something Like box.size = 1000px?

bubesh p
  • 95
  • 2
  • 8

1 Answers1

1

But the problem is if the input is large, That website will display only the small part of standard output. Is there any way to change source code in that website using chrome web developer tools and make it display entire content. Something Like box.size = 1000px?

This is not the actual problem. Check the console for the particular request at: https://practiceapi.geeksforgeeks.org/api/v1/problems/submission/result/

In the response tab you can see that the code_output is itself truncated to some max length.

enter image description here

What is actually happening is that code_output is itself being truncated from server side so you cannot do anything with the css of webpage that will print actual result.

This also makes sense. They are smart people and know how to run their business. Test cases are very precious assets of any online judge. They just won't give it away for free.

Conclusion: you cannot get hidden test cases from any website except there are amateurs who have not properly secured the hidden test cases.

Nirav Madhani
  • 101
  • 1
  • 4