how to change your ip address

0 votes

With the Python code below, I'm creating a web scraper:

import requests

def scrape(url):
    req = requests.get(url)
    with open('out.html', 'w') as f:
        f.write(req.text)

It works for a few times, but eventually the website returns an error HTML page (when I open my browser, I have a captcha to complete)

Is there a method to get over this "ban" by changing your IP address, for example?

Feb 9 in Cyber Security & Ethical Hacking by Edureka
• 8,060 points
86 views

1 answer to this question.

0 votes

Try using the following code. This the most fundamental security technique is to block or limit requests from the same IP address. It indicates that a normal user would not request a hundred pages in a matter of seconds, hence they label that connection as risky.



import requests 
 
response = requests.get('http://httpbin.org/ip') 
print(response.json()['origin']) 
# xyz.84.7.83
answered Feb 21 by Edureka
• 9,540 points

Related Questions In Cyber Security & Ethical Hacking

+1 vote
1 answer

How to find IP address of nodes in my network?

The IP address of the nodes connected ...READ MORE

answered Feb 9, 2019 in Cyber Security & Ethical Hacking by Omkar
• 69,210 points
1,288 views
0 votes
1 answer

How to find MAC address using IP address?

To find the MAC address, run this ...READ MORE

answered Feb 9, 2019 in Cyber Security & Ethical Hacking by Omkar
• 69,210 points
927 views
0 votes
1 answer

how to find ip address in cmd

1. Open the Command Prompt.   a. Click the Start icon, ...READ MORE

answered Feb 9 in Cyber Security & Ethical Hacking by Edureka
• 8,060 points
88 views
0 votes
0 answers

How to get Wi-Fi router IP address on iOS?

Is there any way to get Wi-Fi ...READ MORE

Feb 16 in Cyber Security & Ethical Hacking by Edureka
• 9,540 points
45 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 2,824 views
0 votes
1 answer
0 votes
1 answer

How can I force the login to a specific ip address?

Try to access the router's default page. It's ...READ MORE

answered Feb 15 in Cyber Security & Ethical Hacking by Edureka
• 9,540 points
45 views
0 votes
1 answer

how to find host name from IP with out login to the host

To find host name from IP you ...READ MORE

answered Feb 20 in Cyber Security & Ethical Hacking by Edureka
• 9,540 points
38 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP