If you want to know more
The electron and nucleon interact by the electromagnetic force, the carrier of this is the virtual photon as has different properties to ordinary photons. Take for example two electrons. These repel each other due to the electromagnetic force, we say that there is a mediator or exchange particle which is transferred between them, the photon. If one imagines two ice skaters facing each other and one throws a ball to the other person both skaters will move apart, just as two electrons would repel each other.
When delving inside the proton (or neutron) it is not the electron which actually 'probes' the nucleon but the photon. An electron gives some of its energy (and so loses some of its momentum) to the photon. The more momentum which is transferred to the photon, the more energy it has and so the shorter the wavelength of the photon. One can imagine that a longer wavelength photon will only 'see' the whole nucleon and so be elastically scattered, but for shorter wavelength photons it can 'see' the constituents of the nucleon, the quarks inside. This is why physicists want to build larger and larger accelerators, so that they can see more and more of the structure of particles.