PHP scrapy cURL request not working PHP scrapy cURL request not working curl curl

PHP scrapy cURL request not working


{"status":"error","message":"Spróbuj wykonać operację ponownie. Jeślito nie pomoże, sprawdź czy masz włączoną obsługę JavaScript wprzeglądarce."}

As I mentioned on my comment, you need JavaScript in order to get the phone number. One way to achieve this is using selenium, here's a python example:

import timefrom selenium import webdrivergeckodriver = 'C:/path_to/geckodriver.exe'driver = webdriver.Firefox(executable_path = geckodriver)driver.get("https://www.otodom.pl/mazowieckie/oferta/piekne-mieszkanie-na-mokotowie-do-wynajecia-ID3ezHA.html")driver.find_element_by_class_name("phone-spoiler").click()time.sleep(2)print driver.find_element_by_class_name("phone-number").text# 515 174 616

Notes:

1 - Install Selenium:

pip install selenium

2 - Download the geckodriver
3 - Replace C:/path_to with the path where you saved geckodriver.exe.
4 - Add C:/path_to to your environment.
5 - Restart your system.
6 - Run python name_of_script.py and the phone number will be displayed.

The steps above assume that you're using a windows machine.