Process for treating a feedstock comprising a solid recovery fuel and/or plastics pyrolysis oil, comprising: a) optionally, a selective hydrogenation step performed in a reaction section fed at least with said feedstock and a gas stream comprising hydrogen, in the presence of at least one selective hydrogenation catalyst, at a temperature of between 100 and 280°C, a partial pressure of hydrogen of between 1.0 and 20.0 MPa abs. and an hourly space velocity of between 0.3 and 10.0 h -1, to obtain a hydrogenated effluent; b) a hydroconversion step performed in a hydroconversion reaction section, using at least one ebullated-bed reactor, entrained-bed reactor or moving-bed reactor, comprising at least one hydroconversion catalyst, said hydroconversion reaction section being fed at least with said feedstock or with said hydrogenated effluent obtained on conclusion of step a) and a gas stream comprising hydrogen, said hydroconversion reaction section being operated at a temperature of between 250 and 450°C, a partial pressure of hydrogen of between 1.0 and 20.0 MPa abs. and an hourly space velocity of between 0.05 and 10.0 h -1, to obtain a hydroconverted effluent; c) a separation step, fed with the hydroconverted effluent obtained from step b) and an aqueous solution, said step being performed at a temperature of between 50 and 450°C, to obtain at least one gaseous effluent, an aqueous effluent and a hydrocarbon effluent; d) a step of fractionating all or some of the hydrocarbon effluent obtained from step c), to obtain at least one gas stream, a hydrocarbon cut comprising compounds with a boiling point of less than or equal to 385°C and a hydrocarbon cut comprising compounds with a boiling point above 385°C, e) a hydrotreatment step performed in a hydrotreatment reaction section, using at least one fixed-bed reactor containing n catalytic beds, n being an integer greater than or equal to 1, each comprising at least one hydrotreatment catalyst, said hydrotreatment reaction section being fed with at least some of said hydrocarbon cut comprising compounds with a boiling point of less than or equal to 385°C obtained from step d) and a gas stream comprising hydrogen, said hydrotreatment reaction section being operated at a temperature of between 250 and 430°C, a partial pressure of hydrogen of between 1.0 and 20.0 MPa abs. and an hourly space velocity of between 0.1 and 10.0 h -1, to obtain a hydrotreated effluent; f) a separation step, fed with the hydrotreated effluent obtained from step e) to obtain at least a gaseous effluent and a hydrotreated liquid hydrocarbon effluent. a) optionally, a selective hydrogenation step performed in a reaction section fed at least with said feedstock and a gas stream comprising hydrogen, in the presence of at least one selective hydrogenation catalyst, at a temperature of between 100 and 280°C, a partial pressure of hydrogen of between 1.0 and 20.0 MPa abs. and an hourly space velocity of between 0.3 and 10.0 h -1, to obtain a hydrogenated effluent; b) a hydroconversion step performed in a hydroconversion reaction section, using at least one ebullated-bed reactor, entrained-bed reactor or moving-bed reactor, comprising at least one hydroconversion catalyst, said hydroconversion reaction section being fed at least with said feedstock or with said hydrogenated effluent obtained on conclusion of step a) and a gas stream comprising hydrogen, said hydroconversion reaction section being operated at a temperature of between 250 and 450°C, a partial pressure of hydrogen of between 1.0 and 20.0 MPa abs. and an hourly space velocity of between 0.05 and 10.0 h -1, to obtain a hydroconverted effluent; c) a separation step, fed with the hydroconverted effluent obtained from step b) and an aqueous solution, said step being performed at a temperature of between 50 and 450°C, to obtain at least one gaseous effluent, an aqueous effluent and a hydrocarbon effluent; d) a step of fractionating all or some of the hydrocarbon effluent obtained from step c), to obtain at least one gas stream, a hydrocarbon cut comprising compounds with a boiling point of less than or equal to 385°C and a hydrocarbon cut comprising compounds with a boiling point above 385°C, e) a hydrotreatment step performed in a hydrotreatment reaction section, using at least one fixed-bed reactor containing n catalytic beds, n being an integer greater than or equal to 1, each comprising at least one hydrotreatment catalyst, said hydrotreatment reaction section being fed with at least some of said hydrocarbon cut comprising compounds with a boiling point of less than or equal to 385°C obtained from step d) and a gas stream comprising hydrogen, said hydrotreatment reaction section being operated at a temperature of between 250 and 430°C, a partial pressure of hydrogen of between 1.0 and 20.0 MPa abs. and an hourly space velocity of between 0.1 and 10.0 h -1, to obtain a hydrotreated effluent; f) a separation step, fed with the hydrotreated effluent obtained from step e) to obtain at least a gaseous effluent and a hydrotreated liquid hydrocarbon effluent.