IPRoyal Mobile Proxy Guide

IPRoyal Mobile Proxies: Web Scraping Guide

IPRoyal isn't like most other proxy providers. When buying proxies from IPRoyal, they don't typically manage the proxies for you. You need to manage them yourself. As we get further into this article, you'll see what we mean. They do, however, offer a wide variety of proxy products: Residential Proxies, Datacenter Proxies, Enterprise Proxies, ISP Proxies, and Mobile Proxies. During the rest of this guide, we're going to go through IPRoyal's Mobile Proxies in detail.

Need help scraping the web?

Then check out ScrapeOps, the complete toolkit for web scraping.


TLDR: How to Integrate IPRoyal Mobile Proxy?

Most proxy providers require us to use either an API key or a username and password. IPRoyal is no exception to this rule. Once you've finished setting up your Mobile Proxy, make sure you've got your username and password. Also, make sure you've got the URL of your proxy and your port number. In the code below, you'll for sure need to swap USERNAME and PASSWORD for your own username and password. The IP and PORT might be the same, but you should double check them as well just to be safe. "Measure twice, cut once."
import requests
IP = "us2.4g.iproyal.com"PORT =  7044USERNAME = "your-username"PASSWORD = "your-password"

proxy_url = f"http://{USERNAME}:{PASSWORD}@{IP}:{PORT}"
proxies = {    "http": proxy_url,    "https": proxy_url}
result = requests.get("https://ipv4.icanhazip.com", proxies=proxies)print(result.text)
  • USERNAME, PASSWORD, IP, and PORT are our connection variables.
  • Our connection variables are used to construct our proxy_url.
  • We create a dict object to hold our http and https proxies. We then assign both of them to our proxy_url.
  • Whenever we make a request, we pass proxies=proxies in with the request. This tells Python Requests to forward our requests through our new proxy connection.
To use IPRoyal Mobile proxies, build your unique proxy_url. You can authenticate your requests to this url using your USERNAME and PASSWORD. Once you know how to do that, you're all set to use your new proxy connection however you want.

Understanding Mobile Proxies

What Are Mobile Proxies?

Mobile proxies are proxy servers that use IP addresses assigned by mobile network carriers (e.g., 3G, 4G, or 5G) to route internet traffic through mobile devices. These proxies allow users to mask their real IP address and appear as genuine mobile users.

Why Are Mobile Proxies Important?

Mobile proxies are highly trusted because they utilize real mobile network IPs, making them difficult for websites to detect as proxies. They are often used for tasks requiring anonymity, geo-targeting, or overcoming strict anti-bot systems.

Datacenter vs Premium

Datacenter and Premium Proxies make up the majority of proxy pools in the world. While there are also managed proxy products, these products use Datacenter and Premium Proxies under the hood.
  1. Datacenter proxies are hosted inside a datacenter.
  2. Residential and Mobile Proxies make up the backbone of Premium Proxies.
  3. Managed proxies tend to use a combination of datacenter and premium IP addresses.
In the next few sections, we're going to get a better understanding of these different proxy types.

Datacenter

Pros
  • Price: Datacenter Proxies don't cost much money at all. IPRoyal's Datacenter products can be as cheap as $1.39 per IP address.
  • Speed: With Datacenter Proxies, we get great performance. With this type of proxy, it gets hosted inside of an actual datacenter. Datacenter machines almost always have good hardware with a decent internet connection.
  • Availability: Datacenters are essentially large warehouses of computers. They host tons and tons of machines each with their own IP addresses. Paired with a decent internet connection, you get a reliable proxy with little to no downtime.
Cons
  • Blocking: When you're dealing with more difficult sites, they tend to block datacenter IP addresses. If you don't have a residential or mobile IP, they assume you're up to no good.
  • Less Geotargeting Support: There are a limited amount of datacenters in the world. This means that we get a limited amount of Datacenter Proxy locations to use.
  • Less Anonymity: With a Datacenter Proxy, our IP address will always show up inside of a datacenter. This can become a problem when scraping more difficult sites.

Premium

Pros
  • Anonymity: Premium Proxies provide us with regular IP addresses on actual user devices. There really is no better way to blend in with legitimate traffic.
  • Better Access: When your target site blocks Datacenter Proxies, it most likely won't block a Premium Proxy. Premium IP addresses are their target users!
Cons
  • Price: Premium Proxies are extremely expensive. Mobile Proxies from IPRoyal start at $130 per month! Their Residential Proxies start at $7/GB.
  • Speed: Premium Proxies often don't give us the same performance as Datacenter Proxies. Premium Proxies use actual residential internet connections and mobile data networks.
Residential proxies are ideal for SERP results, ad verification, social media monitoring/scraping and much more.

Mobile vs Residential

Now, it's time to get a better understanding of Mobile and Residential Proxies. While they're similar, there are some important differences to note here. Residential Proxies tend to provide more stable access, but there are definitely some trade-offs when you pick one over the other. Keep reading to learn about their subtle differences.

Residential

Pros
  • Authenticity: On a Residential Proxy, you're using somebody's actual home internet connection. It's hard to look more real than this.
  • Geotargeting: Residential Proxies often give us really good geotargeting support. Sometimes you can even choose which city you want to appear in!
Cons
  • Relatively Static: ISPs don't rotate their addresses often. Sometimes it's weekly, sometimes it's monthly... you get the idea. When facing an IP block, if you're on a Static Residential Proxy, it's not very useful if you can't get a new IP address.
  • Sometimes More Detectable: This is an incredibly uncommon practice, but there are some sites that look for a mobile only environment. They do this by checking both your IP address and user-agent string.

Mobile

Pros
  • Rotating IP Addresses: Mobile phones are constantly switching IP addresses. If you go and walk down the street, your phone will likely start on your residential IP address. Next, it'll switch to your mobile data provider. Perhaps you frequent a coffee shop. Then your phone will likely try to connect to their internet.
  • Carrier Network Address Translation: Some mobile providers put everybody on the same IP address. This form of anonymity works the exact opposite of the rotating addresses mentioned above. With CNAT, you blend in with all other phones on your carrier's IP address.
  • Social Media/ Mobile First Platforms: In the year 2024, regular folks rarely use a computer. Smartphones often meet all of their needs. Because of this, many sites (social media in particular), have adopted a mobile first approach. Mobile proxies make us look far more legitimate on these sites.
Cons
  • Reliability: With Mobile Proxies, it's not uncommon to face reliability issues. If your proxy's IP address rotates during a request, this could easily break your connection.
  • Price: As mentioned earlier, IPRoyal Mobile Proxies are extremely expensive. You can try their proxies at $10/day ($300/month), or you can upgrade to one of their larger plans which range from $117 to $130 per month.

Why Use IPRoyal Mobile Proxies?

IPRoyal gives us a lower level proxy connection with fine-grained control when we set it up. This can be especially great if you need to manage Sticky Sessions. As well, we get unlimited bandwidth. When just trying it out, that might not seem like a big deal. However, if you're running a scraping operation at scale, unlimited bandwidth at $130/month is a really great deal. IPRoyal Homepage We don't get quite the same experience as we do with other proxy providers. We're in charge of our actual proxy IP addresses. However, there are some legitimate perks to doing so this way... especially when scraping at scale.

IPRoyal Mobile Proxy Pricing

Their pricing model is pretty simple. Typical pricing starts at $130 per month. You do get the option to sign up for a 1 day plan, however, this is not a good long term solution ($300/month). The pricing gets much better when you're running a larger operation. As we mentioned earlier, all plans come with unlimited bandwidth. You can get a better look at their plans below.
  • If you're just looking to try it out, you can drop $10 on the 1 day.
  • If you're running a data mining operation, you should strongly consider buying IPRoyal Proxies 90 days at a time.
PlanPrice With DiscountPrice Per MonthDiscount
1 Day$10$300.000%
30 Days$130$130.000%
60 Days$246.99$123.505%
90 Days$350.99$117.0010%
At ScrapeOps, we've created a tool that allows you to shop products from all the best proxy providers. We're here to always get you the best value for your money. You can use our comparison tool here. This tool is built for anybody looking to shop for a proxy provider.

Setting Up IPRoyal Mobile Proxies

Here, let's go through the process of getting IPRoyal Mobile Proxies. We'll start by getting signed up.
  1. From your IPRoyal dashboard, click the Proxies dropdown and select Mobile. This will bring up a small sales page for their Mobile Proxies. Begin the purchase process, click Buy now.
IPRoyal Mobile Proxies
  1. Now, pick the plan that best suits your needs. Since we're just trying it out, we'll go with the 1 Day plan. Select your country of choice, and then click Continue.
Configure Proxies
  1. Once you're ready for IPRoyal to run your card, go ahead and click Complete order.
Complete Purchase
  1. After you've paid, sometimes it takes a few minutes to confirm the order. Don't panic. Once your order has finished processing, you'll have access to your new proxy connection. From our purchase to fulfillment, it took 18 minutes for our proxy to be ready.
If you went with one of the larger plans, you can enable auto-rotating at the bottom of the screen. However, if you went with a 1 day plan, auto-rotate is not an option. Enable auto-rotate If you want to extend your plan, you can simply find your order's Expire date. Under Actions, you can choose to extend your plan. Mobile Proxy Expiry Date

Authentication

To authenticate your requests, you'll need to use your username and password. Think back to the URL we used in the TLDR section. We pass all of our requests into the proxy:
http://{USERNAME}:{PASSWORD}@{IP}:{PORT}
You can obtain these by going to My orders. IPRoyal My Orders Once you've found your order, click on it and scroll down toward the bottom of the page. You should see a spot called Proxy Access. This contains all the information you need in order to use your new Mobile Proxy. IPRoyal Proxy Access

Basic Request Using IPRoyal Mobile Proxies

To make any request with our proxy, we need to forward our request through our proxy_url. We need both our USERNAME and our PASSWORD. Your IP and PORT might be the same as ours below, but it's best to double check. In the code below, we build our proxy_url from the variables we just mentioned. Then, we make a request to https://ipv4.icanhazip.com through this proxy. It yields information about our IP address.
import requests
IP = "us2.4g.iproyal.com"PORT =  7044USERNAME = "your-username"PASSWORD = "your-password"

proxy_url = f"http://{USERNAME}:{PASSWORD}@{IP}:{PORT}"
proxies = {    "http": proxy_url,    "https": proxy_url}
result = requests.get("https://ipv4.icanhazip.com", proxies=proxies)print(result.text)
When you run this code, it will print the IP address of your proxy. Here's our output.
174.204.132.107

Country Geotargeting

Country geotargeting allows users to route their internet traffic through mobile IP addresses associated with a specific country. This feature enables users to simulate online activity as if it originates from mobile devices within that country, making it possible to access localized content, ads, and services. Country geotargeting is possible with IPRoyal Mobile Proxies, but it is rather lacking in comparison to other providers. With most providers, you can pass a special flag in with your URL such as -county-{COUNTRY_CODE}. With IPRoyal, we don't get this option. To use country geotargeting with IPRoyal, we choose our country when setting up the proxy connection. If you remember when we created our proxy, we chose our country when we set it up. If you need a refresher, take a look at the screenshot below. As you can see at the bottom of the shot, we selected United States and our provider is T-Mobile/Verizon. If we would like additional countries, we need to buy additional proxies. Configure Proxies Country level geotargeting with IPRoyal is done when we create our proxy. If you want support for multiple countries, you need to purchase multiple proxies in multiple countries. Because of their unlimited bandwidth, this is a great feature for bandwidth resellers. However, for the end user, this feature is a bit lacking in comparison to other providers such as ScrapeOps, Bright Data, Oxylabs, and Smartproxy. These other providers let you purchase one plan and simply pass a country flag in your URL.

City Geotargeting

City geotargeting enables users to route their internet traffic through mobile IP addresses associated with specific cities. City level geotargeting gives us access to hyper localized content. When you're dealing with local content, you can extract the following types of data at a local level. This allows you to collect and manage your precious data at a much more granular level.
  • Local Ads
  • Local Businesses
  • Local Social Media
  • Local Events
Take one final look at our configuration screenshot. We don't get the option to choose our city. Bright Data, Oxylabs, and Smartproxy do give us the option to use city level geotargeting. You should really only use city geotargeting if you're scraping hyper-localized content. alt text If you need city geotargeting, take a look at the other proxy providers.

Error Codes

Status 200 means that our request was successful and everything is working as expected. When we receive something other than a 200, the server is telling us that something is wrong. No one goes through and memorizes all these status codes. When we receive errors, we need to look up the status code and troubleshoot our code based on what these errors mean. The table below holds a summary of the status codes you might see coming from IPRoyal. If you'd like to learn more about status codes in general, they have a blog post about it here.
Status CodeTypeDescription
200SuccessEverything works as expected.
400Bad RequestYour request was malformed or invalid.
403ForbiddenYour account is forbidden from accessing this content.
404Not FoundThe requested page could not be found.
407Proxy Authentication RequiredDouble check your API key, it's wrong or missing.
408Request TimeoutThe proxy server timed out waiting for the response.
502Bad GatewayInvalid response from the target server.
503Service UnavailableProxy server is overloaded or down for maintenance.
504Gateway TimeoutProxy server timed out waiting for an upstream server.
Status codes are imperative. When you encounter an error, you need to look up the status code and troubleshoot accordingly.

KYC Verification

IPRoyal gives you limited access without undergoing a full blown KYC process. To get full access to their products, you do need to undergo a short identity verification. First, click the dropdown next to your account and click Verify identity. IPRoyal Verify Identity Then, simply click Start verification. Once your identity has been verified, you'll get full access to their Mobile and Residential Proxy products. IPRoyal Identity Verification KYC verification is short, sweet and to the point with IPRoyal. In many cases, you don't even need to use it. This is far less strict than other providers. Bright Data actually makes you undergo a video call with them before you can pass their KYC process.

Implementing IPRoyal Mobile Proxies in Web Scraping

Using proxies is important. However, they're not very useful if we can't hook them up! In the next few sections, we'll implement IPRoyal Mobile Proxies using some of the most popular scraping frameworks. In Python, we'll show some examples for Reqeusts, SeleniumWire (DEPRECATED), and Scrapy. Next, we'll go through how to implement them in NodeJS with Puppeteer and Playwright. By the end of this section, you can get connected with IPRoyal Mobile Proxies easily.

Python Requests

We've been using Python Requests since the beginning of this article. This is a pretty natural place to start since you're already familiar at this point. The code below was used in our TLDR and Basic Request sections. As you know by now, we use our USERNAME and PASSWORD to authenticate the connection.
import requests
IP = "us2.4g.iproyal.com"PORT =  7044USERNAME = "your-username"PASSWORD = "your-password"

proxy_url = f"http://{USERNAME}:{PASSWORD}@{IP}:{PORT}"
proxies = {    "http": proxy_url,    "https": proxy_url}
result = requests.get("https://ipv4.icanhazip.com", proxies=proxies)print(result.text)
  • As we have through this turorial, we first create our config variables: IP, PORT, USERNAME, and PASSWORD.
  • These variables get combined to create our proxy_url: http://{USERNAME}:{PASSWORD}@{IP}:{PORT}.
  • We then create a dict object that holds both our http and https proxies.
  • We always pass proxies=proxies when making a request. This tells Python Requests to use the dict object we created earlier.

Python Selenium

SeleniumWire has always been the go-to if you're using proxies with Selenium. If you didn't already know, Vanilla Selenium does not support authenticated proxies. Sadly, SeleniumWire has been deprecated. It hasn't received any code updates in two years and will likely never receive them again. However, it is still technically possible to integrate IPRoyal Mobile Proxies via SeleniumWire, but we strongly advise against it. When you decide to use SeleniumWire, you are vulnerable to the following risks:
  • Security: Browsers are updated with security patches regularly. Without these patches, your browser will have holes in the security that have been fixed in other browsers such as Chromedriver or Geckodriver.
  • Dependency Issues: SeleniumWire is no longer maintained. In time, it may not be able to keep up with its dependencies as they get updated. Broken dependencies can be a source of unending headache for anyone in software development.
  • Compatibility: As the web itself gets updated, SeleniumWire doesn't. Regular browsers are updated all the time. Since SeleniumWire no longer receives updates, you may experience broken functionality and unexpected behavior.
As time goes on, the probability of all these problems increases. If you understand the risks but still wish to use SeleniumWire, you can view a guide on that here. Depending on your time of reading, the code example below may or may not work. As mentioned above, we strongly recommend against using SeleniumWire because of its deprecation, but if you decide to do so anyway, here you go. We are not responsible for any damage that this may cause to your machine or your privacy. As well, the example below does not contain any retry logic for bad responses. If you wish to do so, you can add this in yourself.
from seleniumwire import webdriverimport json
IP = "us2.4g.iproyal.com"PORT =  7044USERNAME = "your-username"PASSWORD = "your-password"

proxy_url = f"http://{USERNAME}:{PASSWORD}@{IP}:{PORT}"
## Define Your Proxy Endpointsproxy_options = {    "proxy": {        "http": proxy_url,        "https": proxy_url,        "no_proxy": "localhost:127.0.0.1"    }}
## Set Up Selenium Chrome driverdriver = webdriver.Chrome(seleniumwire_options=proxy_options)
## Send Request Using Proxydriver.get('https://httpbin.org/ip')
  • We build our proxy_url from our IP, PORT, USERNAME and PASSWORD.
  • We assign our proxy_url to both the http and https protocols inside of our proxy_options dict.
  • driver = webdriver.Chrome(seleniumwire_options=proxy_options) tells webdriver to open Chrome with our custom seleniumwire_options.

Python Scrapy

Now, we'll code our new Mobile Proxy directly into a Scrapy spider. This will tell the spider to use our Mobile Proxy connection by default anytime it makes a request. This makes our configuration very easy to handle. To start, we need to make a new Scrapy project.
scrapy startproject mobile
Then, from within your new Scrapy project, create a new Python file inside the spiders folder with the following code.
import scrapy
IP = "us2.4g.iproyal.com"PORT =  7044USERNAME = "your-username"PASSWORD = "your-password"

proxy_url = f"http://{USERNAME}:{PASSWORD}@{IP}:{PORT}"

class ExampleSpider(scrapy.Spider):    name = "mobile_proxy"
    def start_requests(self):        request = scrapy.Request(url="https://httpbin.org/ip", callback=self.parse)        request.meta['proxy'] = proxy_url        yield request
    def parse(self, response):        print(response.body)
You can run this spider with the following command.
scrapy crawl mobile_proxy
  • Again, we start by saving our configuration variables.
  • Afterward, we create our proxy_url.
  • From inside the start_requests method, we assign our proxy_url to request.meta['proxy']. This tells Scrapy that all of this spider's requests should go through the proxy_url we created earlier.

NodeJS Puppeteer

To implement with NodeJS Puppeteer, we're going to use Puppeteer along with some additional plugins. Puppeteer does provide authenticated proxy support, but during our testing, the connection wasn't consistent. In this example, we're going to make use of Puppeteer's proxy and stealth plugins. Create a new folder.
mkdir puppeteer-mobile
cd into the new folder and create a new JavaScript project.
cd puppeteer-mobilenpm init --y
Next, we need to install Puppeteer.
npm install puppeteer
Now, we'll install Puppeteer Extra. This allows us to use special plugins with Puppeteer.
npm install puppeteer-extra
Then, we'll install the Stealth plugin.
npm install puppeteer-extra-plugin-stealth
Finally, we are going to install the Proxy plugin as well. When working with spotty connections (such as Mobile Proxies), this can be a great help.
npm install puppeteer-extra-plugin-proxy
Next, create a new JavaScript file. Copy and Paste the code below into your new file.
const puppeteer = require("puppeteer-extra");const StealthPlugin = require("puppeteer-extra-plugin-stealth");const ProxyPlugin = require('puppeteer-extra-plugin-proxy');
puppeteer.use(StealthPlugin());puppeteer.use(  ProxyPlugin({    address: "us2.4g.iproyal.com",    port: 7044,    credentials: {      username: "your-username",      password: "your-password",    },  }));
(async () => {  const browser = await puppeteer.launch();  const page = await browser.newPage();
  try {    await page.goto("http://lumtest.com/myip.json");    await page.screenshot({ path: "puppeteer.png" });    console.log("Screenshot successful");  } catch (err) {    console.error("Error:", err);  } finally {    await browser.close();  }})();
  • puppeteer.use() invokes both of the plugins we installed.
  • We add our proxy url to our to the address field of our proxy plugin: address: "us2.4g.iproyal.com".
  • We also pass our port number: 7044.
  • In the credentials field, we give our username and password.
  • username: "your-username"
  • password: "your-password"
  • Once we've gone through our intial setup process, we can go through and code the rest of our Puppeteer logic as normal.
  • Near the end of the script, we take a screenshot of our location information.
The screenshot below came from running the Puppeteer code above. Puppeteer Proxy Results

NodeJS Playwright

Playwright integration is pretty similar to our integration with the Puppeteer plugins. Puppeteer and Playwright actually share a common origin coming from Chrome's DevTools. If you look closely at the code below, we do exactly the same thing using Playwright's builtin proxy support. Create a new project folder.
mkdir playwright-mobile
cd into the new folder and initialize a JavaScript project.
cd playwright-mobilenpm init --y
Install Playwright.
npm install playwrightnpx playwright install
Next, you can copy/paste the code below into a JavaScript file. Once again, make sure to add your proxy list to your project folder.
const playwright = require("playwright");
const IP = "us2.4g.iproyal.com";const PORT =  7044;const USERNAME = "your-username";const PASSWORD = "your-password";
const proxyUrl = `http://${IP}:${PORT}`;
const options = {    proxy: {        server: proxyUrl,        username: USERNAME,        password: PASSWORD    }};
(async () => {    const browser = await playwright.chromium.launch(options);        var success = false;        while (!success) {        const page = await browser.newPage();
        try {            const response = await page.goto('http://lumtest.com/myip.json');            if (response.status() !== 200) {                throw new Error(`Failed respoonse, Status Code: ${response.status()}`);            }            await page.screenshot({ path: "playwright.png" });            console.log("screenshot successful");            success = true;        } catch (error) {            console.log("ERROR:", error);        } finally {            await page.close();        }
    }    await browser.close();    })();
  • Like our Puppeteer example, all of our proxy information gets stored inside a JSON object.
  • We create a proxy object within our options. proxy holds the following fields:
  • server: proxyUrl
  • username: USERNAME
  • password: PASSWORD
With Playwright, we get the same proxy support we get from the additional plugins we used with Puppeteer. Everything works right out of the box. You can view an example response in the screenshot below. Playwright Proxy Results

Case Study: Scrape Weather.com

To get a better understanding of our new proxy connection, we're going to scrape metadata from weather.com. We really only need to scrape the site description. This exercise is more about concepts than it is about data harvesting. We'll scrape the site description using both a Portuguese location and a US based location. We'll count the amount of tries it takes as well. Our case study should teach us a couple different things.
  • For one proxy, we'll be using a US based Mobile Proxy from IPRoyal.
  • We'll also use a Portuguese mobile proxy from ScrapeOps.
  • We'll test the reliability of each proxy by counting how many tries it takes to retrieve our content.
Take a look at the code below.
  1. We start by disabling some warnings to prevent SSL errors from clogging up the console.
  2. Our first proxy connection is located in Portugal using the ScrapeOps Residential Proxy Aggregator.
  3. First, we scrape the site description.
  4. We count the tries it takes and then print both our tries and description to the terminal.
  5. We repeat this process using our US Mobile Proxy from IPRoyal as well.
import requestsimport urllib3from bs4 import BeautifulSoup
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

COUNTRY = "pt"API_KEY = "your-super-secret-api-key"
proxy_url = f"http://scrapeops.mobile=true.country={COUNTRY}:{API_KEY}@residential-proxy.scrapeops.io:8181"
proxies = {    "http": proxy_url,    "https": proxy_url}

proxies = {  "http": proxy_url,  "https": proxy_url}
headers = {    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"}
print("----------------------PT-------------------")
success = False
tries = 1while not success:    response = requests.get("https://weather.com", proxies=proxies, headers=headers, verify=False)    if response.status_code != 200:        print(f"Failed to get site, Status Code: {response.status_code}")        tries+=1        continue
    soup = BeautifulSoup(response.text, "html.parser")    description_tag = soup.select_one("meta[name='description']")    description = description_tag.get("content")
    print("Description:", description)    print("Total tries:", tries)    success = True

print("----------------------US---------------------")
IP = "us2.4g.iproyal.com"PORT =  7044USERNAME = "your-username"PASSWORD = "your-password"

proxy_url = f"http://{USERNAME}:{PASSWORD}@{IP}:{PORT}"
proxies = {  "http": proxy_url,  "https": proxy_url}
success = Falsetries = 1while not success:    response = requests.get("https://weather.com", proxies=proxies, headers=headers, verify=False)    if response.status_code != 200:        print(f"Failed to get site, Status Code: {response.status_code}")        tries+=1        continue
    soup = BeautifulSoup(response.text, "html.parser")    description_tag = soup.select_one("meta[name='description']")    description = description_tag.get("content")
    print("Description:", description)    print("Total tries", tries)    success = True
Here are some key things you should notice in this code:
  • urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) disables any SSL warnings from clogging up our output.
  • We setup our ScrapeOps connection:
  • COUNTRY = "pt" sets our country variable to Portugal. We also save our API_KEY.
  • Then, we create our proxy_url: http://scrapeops.mobile=true.country={COUNTRY}:{API_KEY}@residential-proxy.scrapeops.io:8181.
  • mobile=true is used to tell ScrapeOps that we want a mobile IP address.
  • country={COUNTRY} tells ScrapeOps that we also want an IP address in Portugal.
  • Our IPRoyal connection is a bit easier to create, but that is mainly due to the limited geotargeting we get from IPRoyal:
  • We create the same proxy_url we've been using all throughout this tutorial.
  • We don't pass in any special flags. Our proxy uses Mobile Proxies because we paid for mobile specifically. We are based in the US because that's where we created our proxy connection.
If you run this code, you shuuld receive something similar to this.
----------------------PT------------------- Description: Previsão e condições meteorológicas e radar Doppler de hoje e de hoje à noite para Socorro, Lisboa por The Weather Channel e Weather.com Total tries: 1 ----------------------US--------------------- Description: The Weather Channel and weather.com provide a national and local weather forecast for cities, as well as weather radar, report and hurricane coverage Total tries 1
Take a look at our site descriptions for each proxy.
  • Portugal: Previsão e condições meteorológicas e radar Doppler de hoje e de hoje à noite para Socorro, Lisboa por The Weather Channel e Weather.com.
  • United States: The Weather Channel and weather.com provide a national and local weather forecast for cities, as well as weather radar, report and hurricane coverage.
Now, take a look at our total tries for each proxy.
  • Portugal: 1
  • United States: 1
To summarize our results: When using our ScrapeOps Portuguese proxy, our site comes written in Portuguese. With our US based proxy from IPRoyal, our site is written in English. Both proxies were able to receive a response on the first try. Mobile Proxies from the ScrapeOps Residential Proxy Aggregator can stand toe to toe with the best Mobile Proxies that IPRoyal has to offer.

Alternative: ScrapeOps Residential Proxy Aggregator

IPRoyal Mobile Proxies are pretty expensive when you're just trying them out. At ScrapeOps, we offer a Residential Proxy Aggregator that also gives you access to mobile proxies. Our Residential Proxies from ScrapeOps are almost unbeatable when it comes to price. With the mobile flag, you can even use a mobile-only proxy... for far less than you pay with IPRoyal. We also give you far better geotargeting support. ScrapeOps Residential Proxy Aggregator provides access to the top 20 residential proxy providers through a single port, ensuring a high success rate for web scraping tasks. It automatically switches proxies to avoid blocks, optimizing performance and cost with flexible pricing plans.
  • Access to the top 20 residential proxy providers, including Smartproxy, Bright Data, and Oxylabs.
  • 98% success rate due to automatic proxy switching.
  • Bypasses anti-bot measures and avoids blocks.
  • Optimizes performance and cost by monitoring proxy performance and pricing.
  • Flexible pricing plans starting at $15 per month, with up to $999 for higher usage.
  • 500 MB of free bandwidth credits to start.
Our plans range in price from free (yes... FREE) all the way to $999 per month. We have 8 different choices available. The table below outlines our pricing.
Monthly PriceBandwidthPrice per GB
Free100MB$0
$153GB$5
$4510GB$4.50
$9925GB$3.96
$14950GB$2.98
$249100GB$2.49
$449200GB$2.25
$999500GB$2
We use proxies from all sorts of providers around the world... including IPRoyal. We give you better geotargeting, and we also give you better pricing. The only thing IPRoyal beats us on is their unlimited bandwidth. Go a head and start your ScrapeOps free trial here. Once you've got your free trial, you can copy and paste the code below to check your proxy connection.
import requestsfrom urllib.parse import urlencode
API_KEY = "your-super-secret-api-key"
proxy_url = f"http://scrapeops.mobile=true:{API_KEY}@residential-proxy.scrapeops.io:8181"
proxies = {    "http": proxy_url,    "https": proxy_url}
response = requests.get("https://lumtest.com/myip.json", proxies=proxies, verify=False)print(response.text)
In the code above, we do the following.
  • Create our configuration variable: API_KEY.
  • We then build our proxy_url: http://scrapeops.mobile=true:{API_KEY}@residential-proxy.scrapeops.io:8181.
  • The flag, mobile=true, tells ScrapeOps that we want a mobile IP address.
  • We check our IP information by making a GET: requests.get("https://lumtest.com/myip.json", proxies=proxies, verify=False).
  • Finally, we print it to the terminal. You should get an output similar to what you see below. We removed the SSL warning to make the output more legible.
{"country":"IN","asn":{"asnum":38266,"org_name":"Vodafone Idea Ltd"},"geo":{"city":"Coimbatore","region":"TN","region_name":"Tamil Nadu","postal_code":"641012","latitude":11.0142,"longitude":76.9941,"tz":"Asia/Kolkata","lum_city":"coimbatore","lum_region":"tn"}}
The org_name, Vodafone Idea Ltd, is where you should really pay attention here. Vodafone provides mobile data in many countries all over the world. We're passing mobile and getting a mobile IP address. Even though it's in beta, our Residential Proxy Aggregator can hang with the best the market has to offer. On top of that, we provide bandwidth for people of all needs. Our low tier paid plan costs $5/GB and we have a 500GB top tier plan coming in at $2/GB.
IPRoyal is committed to providing ethical proxies. Without KYC, they limit your access to their products. Anyone providing proxy bandwidth is doing so knowingly. You can read more about IPRoyal's commitment to ethical proxies here. When mobile and residential proxies are sourced, they come from real people using real devices on their real internet connection. Ethical sourcing of residential proxies means that everyone providing bandwidth knows they're providing bandwidth. When we use datacenter proxies, they come from a datacenter, there is no way that our proxy could come from a user unknowingly running software on their smartphone. Breaking the law with a proxy provider is a terrible idea. As you already know, it's illegal. Another thing you might not have considered: it harms everyone involved. It harms the proxy provider. It harms you too.
  • First, your actions get traced to the provider.
  • Then, the provider will trace it to your account using either your API key or your username and password.
This creates problems for both you and your proxy service.
  • Don't use proxies to access illegal content: Depending on the severity of your actions, you could face hefty fines, or even prison time.
  • Don't scrape and disseminate other people's private data: Depending on what your jurisdiction, this is also a highly illegal and dangerous practice. Doxxing private data can also lead to heavy fines and possibly jail/prison time.

Ethical

We shouldn't just worry about legal and illegal. We need to think about right and wrong. When something is legal, it's not necessarily right. Nobody wants to be in the next headline about ethically questionable data collection. Questionable ethics can destroy your company and even your personal reputation.
  • Social Media Monitoring: Social media stalking can be a very destructive and disrespectful behavior. How would you feel if someone used data collection methods on your account?
  • Respect Site Policies: Failure to respect a site's policies can get your account suspended/banned. It can even lead to legal troubles for those of you who sign and violate a terms of service agreement.
IPRoyal prides itself on using ethically sourced proxies, and they will protect the people gracious enough to lend out their bandwidth as well. If you're more interested in learning about their ethics, check it out here.

Conclusion

Mobile proxies are among the best when you're looking for anti-bot resistance. By now, you know that datacenter proxies are an excellent value, but sometimes they just can't get the job done. When you use Mobile Proxies from IPRoyal or ScrapeOps, you get all the benefits of a Residential Proxy and more! You should also have a decent understanding of how to implement Mobile Proxies using Python Requests, Scrapy, NodeJS Puppeteer and NodeJS Playwright. IPRoyal's full Mobile Proxy documentation is available here.

More Cool Articles

Ready to read more? At ScrapeOps we have a ton of content that you can learn from. Whether you're a seasoned dev or you're brand new to web scraping, we've got something useful for you. We love scraping so much that we wrote the Python Web Scraping Playbook. If you want to learn more, take a look at the articles below.