There is two way to serve a mobile page.
You can first just check URL. As the example you gave in comments m.youtube.com
explicit the fact you are browsing in mobile mode.
But you can check the HTTP header User-Agent
too. This header show what browser was used to send query.
The server can extract this info and according to given value can determine if browser is mobile or desktop one.
This will be your main issue here, all web servers does not use the same method to handle mobile templates. Lot of websites use both methods I explained and it will be hard to create a generic scraper that find alone how to access to mobile template.
Si what you can do:
Use a mobile browser with selenium: https://github.com/SeleniumHQ/selenium/wiki/WebDriver-For-Mobile-Browsers
Or
If you want to dynamically switch from desktop to mobile, play with user-agent: Change user agent for selenium driver