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, 2022 in Cyber Security & Ethical Hacking by Edureka
• 13,620 points
487 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, 2022 by Edureka
• 12,690 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
4,317 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
2,052 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, 2022 in Cyber Security & Ethical Hacking by Edureka
• 13,620 points
46,518 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, 2022 in Cyber Security & Ethical Hacking by Edureka
• 12,690 points
432 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 4,070 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, 2022 in Cyber Security & Ethical Hacking by Edureka
• 12,690 points
1,148 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP