473,408 Members | 1,982 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

How Can ı scrape diffrent page's data onto my current data?(into excel)

import requests
from bs4 import BeautifulSoup
from pprint import pprint
import pandas as pd

page = requests.get('https://www.arabam.com/ikinci-el/motosiklet/honda?view=List&take=50')
soup = BeautifulSoup(page.text, 'lxml')
rows = []
kolon = []
for tr in soup.select('tr'):
row = [td.text.strip() for td in tr.select('td') if td.text.strip() and td.text.strip() != '-']
if len(row)>6:
row[7] = row[7][:-98]
rows.append(row)


for column in rows[1:]:
kolon.append(column)



from openpyxl import load_workbook
writer =pd.ExcelWriter('test.xlsx', engine='openpyxl')
wb = writer.book
df = pd.DataFrame(kolon)
df.to_excel(writer, index=False)
wb.save('test.xlsx')

# We scraped 51 row car information with those codes from first page into test.xlsx but we have to make that 500 row but other datas are in next pages and we dont know how to add these datas onto current test.xlsx file. How can we add diffrent page's datas to previous datas?

Web-site:https://www.arabam.com/ikinci-el/motosiklet/honda?view=List&take=50
Nov 23 '20 #1
2 2963


Nov 23 '20 #2
Just downloading the first page and then using beautifulsoup isn't going to cut it, you need the 'brains' to also parse the javascript or other scripts that feature extra functionality in the page. You need to use some framework like selenium to interface a browser.
Nov 26 '20 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Grey | last post by:
How to export a dataset to excel file. I need the exported data should be named with variable in excel as I need to do pivot table in the excel. So do I need to created pivot table before and only...
2
by: TM | last post by:
I have an Excel sheet where I setup my needed formatting, page settings, ect, and would like to take my data from a datagrid and paste it into the excel file and print the excel file. Any idea...
0
by: Mamatha | last post by:
Hi When i clicked a button, i want to insert data from listview in VB.NET to Excel sheet. If you know the solution either above or below is ok for me. I know how to insert from a textfile,but...
2
by: susisri | last post by:
Hi, if any one please clear my doubt. i created one form in vb.it contains(empid,othertsk,descrption....etc) if any user fill these details click ok then these details are saved into the Excel...
0
by: Marc Scheuner | last post by:
Folks, we're trying to stream back a result set from a SQL query into Excel from our ASP.NET application. Basically, we're doing this here: Response.ContentType = "text/csv";...
2
by: defabiisk | last post by:
Hello, I'm trying to open some data I've collected in my Perl DBI script - in excel. I'm using Javascript function to try and open the data in execl - without trying to do a SaveAs first. So I...
2
by: Dhananjay | last post by:
Hi all , I have got problem when i am tring to exportGridview Data into Excel format. It is going into text format ,but what i want is if the field is number/currency then it should go into...
5
by: sangeethass | last post by:
How to export sql server-2005 table data into excel sheet .. Can u tell me how can i do this both my manually and by programmewise using perl please help me... thanks Sangeetha.S
7
by: kpresidente | last post by:
Hello all, I'm trying to transfer the value of a control on an Access form to an Excel worksheet using VBA. The Access form is a single form with all the controls disabled, so that data is "read...
1
by: MitchelVolk | last post by:
I have an (ADDRESS) table of data that I imported into Access. I developed a query and an edit form for data entry into a new table (MAIN TABLE) that has other fields. I am lost on how to do this?
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.