Obtained, read, viewed, learned, discovered.
The knowledge wasn't obtained illegally or illicitly, immorally perhaps.
Illegal entry/trespass is a crime regardless of the method used however.
In your analogy copying the code (online content) isn't necessarily illegal, however using that knowledge without compensation, permission or attribution may be a crime (depending on copyright law, judges rulings etc).
This point makes sense to me. I agree with "learned" and "discovered".
https://blog.curiousquail.com/im-upset-again-about-a-co-crea...
What about using torrents to acquire that content?